Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Updating MaterialID in MetaCGOptions at Runtime
#1
Does updating MaterialID in MetaCGOptions on an already generated segment switch the active material?

I have a Volume Mesh with two material slots, id 0 and id 1. I want to flip between them at runtime, on an already (runtime) generated spline. 

var spline = obj.GetComponent<CurvySpline>();

foreach (var point in spline.ControlPointsList)
{
    var cg = point.GetMetadata<MetaCGOptions>(true);
    cg.MaterialID = 1;
}

spline.SetDirtyAll();


This currently doesn't make any difference.
Reply


Messages In This Thread
Updating MaterialID in MetaCGOptions at Runtime - by boriskourt - 06-13-2021, 08:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Set Volume to the Volume Controller at Runtime pako88 2 10 04-08-2024, 03:26 PM
Last Post: _Aka_
  Avoiding runtime GC allocations on control point position change Ell223 8 18 02-24-2024, 10:43 AM
Last Post: _Aka_
Wink Modifying Splines at Runtime artsung 1 7 01-30-2024, 09:40 AM
Last Post: _Aka_
  Is it possible to create a road texture at runtime? artsung 1 4 01-30-2024, 09:30 AM
Last Post: _Aka_

Forum Jump: