puhovik wrote:Hello. Can somebody help with my task. I want to do a dynamic keyframe. i think i should use CompRenderEnd param. i want to have a possibility to change a fusion composition lenght wiouth a manual moving of keyframes. for example i want to make my animation in 30 frames before the end
Yeah you can use comp.RenderEnd to get the last frame of the render range, and comp.RenderStart is the first frame.
As a very simple example, you could animate a Mask's Level property with this expression:
- Code: Select all
iif(time >= comp.RenderEnd - 50, 1, 0)
This would set Level to 1 for the last 50 frames of the composition, and 0 before that.
If you want Level to do a linear animation, eg from 0 to 1 over the last 50 frames of the composition, you could do:
- Code: Select all
: diff = comp.RenderEnd - time ; return (diff <= 50) and 1 - (diff / 1/50) or 0
This example uses full Lua syntax, which is specified by the
: at the start of the line.
To do a custom animation curve with easing is a bit more complex. Let me know if you need that.
Note there is also the option of using the Keyframe Stretcher node or modifier. This allows the automatic stretching of hardcoded keyframes to be adjusted according to composition length. I don't know if it's suitable for what you need - read about it on page 2223 of the Resolve 16.2.7 manual. Let us know if you need more info on that method.