i would like to find a way to interpolate values that change each "random" frames. I can't use FCurve because i don't know the new values and they born from complex function f(obj.location) while the entire animation.
Example: i have value 5 from frame 1 to 30 then value 20 from frame 31 to 80 then value 9.5 from 81 to 102 and so on.
Here there is a file with the example than you can download but there is a problem. Each time the new value borns there is a flickering in the animation for two frames and then the interpolation is fine.
Anyone can tell me if this approach is the best or if is there a better method to solve my generic goal?
For info the flow of the example in the file is
- time starts
- when new value (in the file is a new random value) borns a set an attribute of an object
- in an second animation nodes layout i trigger the changed of the attribute and i "save" current frame and previous frame in other 2 attributes of the object
- the first animation nodes layout can, at this point, assign new value of map range (min and max) to interpolate. the trick is shift max value to the min and assign new max from new random value.
- at the same time i reset the value of map range with 0 (current frame - last current frame saved by triggering the random value change).
- as a result i have a loop of interpolation from min and max each time the new random value borns.
Thank you very much!