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
  Bezier subdevision not smooth (sometimes) Kapistijn 1 720 02-08-2026, 08:40 PM
Last Post: _Aka_
  Morph game object along curve. mikechr2000 5 3,380 02-04-2025, 09:30 PM
Last Post: _Aka_
  Scaling a closed curve rickgplus 1 1,652 01-16-2025, 06:52 PM
Last Post: _Aka_
  Updated package in 2022 LTS resulted in multiple errors scr33ner 2 1,941 01-13-2025, 09:32 AM
Last Post: _Aka_

Forum Jump: