Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bezier curve takes multiple frames to resolve
#1
I have got a situation where I'm animating a CurvySpline using Bezier interpolation in code. Every frame during the sequence both the control points and the handles are modified. I kept seeing extremely strange and undesired shapes when I have the animation using a Coroutine to advance, but when I set it up to be something I could scrub from the inspector, it looked correct.

Finally I discovered that the scrubbing was actually obscuring the issue. What I found out after setting up my tests in a certain way where I could change the curve and step over frames is that the Bezier curve seems to take 3-4 frames before it actually resolves to how it is supposed to look. This is really strange behavior. I could understand it taking one frame due to script execution order, but I can't understand why it would take multiple frames beyond that.

I really need a way to instantly get the Bezier curve to recalculate properly without waiting for a frame. In my class that modifies the control points and handles, I added SetDirtyAll() and Refresh() to the end of the function hoping that this would force Curvy to recalculate the curve, but it doesn't actually change anything.

I could use some pointers on how I can make sure that the whole curve is re-evaluated immediately after I change its control points and handles in code.

Thanks.
Reply


Messages In This Thread
Bezier curve takes multiple frames to resolve - by freqout - 03-15-2018, 08:02 PM

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_
  Distance travelled across multiple splines jh092 1 7 02-23-2024, 09:44 AM
Last Post: _Aka_
  Multiple Splines and Generators Performantly for Road System drock 1 6 07-17-2023, 10:31 AM
Last Post: _Aka_
  Can Curve Spline be used for an in game level editor. Lupos 30 71 06-03-2023, 10:58 AM
Last Post: _Aka_

Forum Jump: