Hello. I'm developing a plugin for Fusion that will simulate spring behavior to create smoother animations. The problem with the spring is that its velocity must be calculated from the very beginning and remain continuous. So I have to recalculate the values from scratch for every frame. I can’t cache the values because I haven’t found any mechanisms to invalidate the cache afterward. The longer the composition and the higher the FPS, the more frames need to be recalculated.
My problem is that I have to call GetSource on all input parameters for every frame. Each call takes quite a long time, and in total, the render time for a single frame easily exceeds 18ms, which is unacceptable.
Fusion has quite a lot of undocumented API that I can only find through LLM results. But it seems I’ve reached a point where this is much more hallucination than what is actually available in modern Fusion.
Ideally, I’d like to cache the values so I don’t have to recalculate everything every time. But NotifyChanged behaves strangely for animated parameters and doesn’t make sense.
So I’m trying to optimize the process of retrieving the values itself. Is it possible to call GetSource() once for all Inputs at once? Or is there some other way to get all the values for a single Input, but as a table of values over time?
I’d appreciate any tips.