Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing material of Volume spot at creation?
#5
(08-10-2023, 06:53 PM)_RicO Wrote: Your solution did work, but I didn't realize it would be called each frame. I thought the callback was called only every time a volume spot is added. Is that possible?

The idea, is that I need to make sure the material is the "selected" color, and want to "fade in" (adjust color alpha) the volume spot mesh every time a new one is created. So it would make for a smooth "volume spot" spline animation.

The OnRefresh event is not triggered every frame, but only when the generator/module is refreshes. If no input changes (the spline, the placed object, etc.) the event is not triggered.

For complex behaviors regarding the materials, you can code your own logic which would keep track of the number of placed objects, and apply the fading when appropriate. Such logic would be triggered in the OnRefresh listener.
Please keep in mind that when refreshing, all the created objects are removed then added. This means that there are no guarantees that the object at position P pre-refresh stays at the same position post-refresh.
The generator uses pooling, so removing/adding objects should not have a significant performance impact.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Messages In This Thread
RE: Changing material of Volume spot at creation? - by _Aka_ - 08-11-2023, 09:37 AM

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_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
Question Volume Spots inter group distance Sacryn 1 3 02-27-2024, 04:08 PM
Last Post: _Aka_
  Changing Lanes Antonio 1 11 09-17-2023, 08:23 PM
Last Post: _Aka_

Forum Jump: