Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CurvyGenerator not refreshing until next frame when created.
#1
After some a bunch of testing and reading other threads I've found that the CurvyGenerator doesn't seem to refresh immediately until it has initialized. This initialization step seems to take a frame since delaying reading data from it 1 frame seems to fix the issue. 

I've tried forcing initialization on creation with curvyGenerator.Initialize(true) with no success. 

Is there a way to force initialization right away so I can refresh data based on its results? This is rather important for some collision tests and data reading.

Or is the other alternative to force waiting to do anything with the data until 1 frame. if so this is a bit of a hinderence but still doable. Ideally id like to avoid this.
Reply
#2
Hi

As of 8.7.0, the initialization of the CG is indeed done in the first call to Update. It should ideally be done in OnEnabled. Doing this change is not trivial due to the complexity of the initialization process (generator depends on modules, which depend on their inputs such as splines). Simplifying the initialization process and thus executing it earlier is a task that is already in the backlog, but not planned for the near future. Sorry for that.

The workaround right now is to check the IsInitialized property of the generator before using it. You can either do that in your update method, or listen to the OnRefresh event of the generator. There is no OnInitialized event for generators as of 8.7.0, but I am planning to add it in one of the next updates.
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#3
Also, this might interest you: https://curvyeditor.com/documentation/extend/apigeneral#curvy_generator
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_
  Collider doesn't get created by the CreateMesh Module pako88 5 11 12-26-2023, 11:13 AM
Last Post: _Aka_
  Optimum configuration for frame-by-frame updates FanManPro 5 11 04-10-2023, 10:13 PM
Last Post: _Aka_
Question Including scripts on created meshes lewsk55 1 15 10-04-2022, 10:46 PM
Last Post: _Aka_

Forum Jump: