Keyframes: stretch to fit

User avatar
brysend
Posts: 4
Joined: Sat Nov 09, 2019 6:04 pm

Keyframes: stretch to fit

#1

Post by brysend » Sat Nov 09, 2019 6:21 pm

Hello there fusion fam, ran into an issue while working with adjustment layer.

goal : speed up or slow down adjustment clip keyframes depending on comp.renderTime

1. Start by dragging adjustment clip into resolve timeline and place it on top of a clip
2. Open /edit that adjustment layer in Fusion tab.
3. Add effects like Transform and use keyframes to animate Transform params to create an animation effect
4. Now see the results in Resolve.

The issue:
1. Increasing or decreasing Adjustment Clip duration in Resolve does not stretch the Keyframes out, which were made in Fusion
2. I was expecting the Animation to slow down or sped up if Duration of adjustment clip changes.
3. The keyFrames do not adjust automatically

What I have tried:
1. In resolve right clicking on the Adjustment Clip and changing Clip Speed > Stretch to Fit (did not work)
2. I copied the KeyFrames from my Transform and created a Custom Tool and pasted KeyFrames to a control
3. I wrote an expression in the Transform like so : `customToolNumber1.value/comp.renderTime - time` so it would read from there.
4. Now I tried incorporating `time` variable in the expression, to factor in the Timeframe and FPS with no luck. (did not work)
5. Also not sure how to stretch keyframe values using time variable
6. Tried looking into Lua scripting, which does give ability to Set Keyframes with code, but wanted to try easier solutions first


I was hoping Fusion would have a way to automatically stretch these keyframes out in resolve if we change adjustment clip duration, hence speeding or slowing down the effect. Taking time into factor into setting the keyframe value


_______________________
Screen Shot 2019-11-09 at 6.21.04 PM.png
Screen Shot 2019-11-09 at 6.22.03 PM.png
by SecondMan » Sun Nov 10, 2019 12:55 am
In DaVinci Resolve, KeyframeStretcher is supposed to work in conjunction with Resolve's Edit page.

You can figure out the way it works more easily in Fusion Standalone, where you have direct control over the comp's GlobalStart and GlobalEnd, which in Resolve are determined by the Edit timeline (not sure if I describe this 100% correctly).

KeyframeStretcher.PNG

Essentially what it does in Resolve is the following. It scales (time-stretches) whatever is inbetween Source Start and Source End to the length of the clip in the timeline.

The Stretch Start and Stretch End determine which part of the source is being stretched, and which is untouched.

In the default example above, the source timing of anything between frames 0 and 24, and anything between frames 96 and 120 will remain unaffected, but if the clip in the timeline is longer than 120 frames, anything between 24 and 96 will be stretched.

When Stretch Edges Instead is checked, the source timing of anything between frames 0 and 24, and anything between frames 96 and 120 will stretch, but anything between 24 and 96 will remain unaffected.

Consequently, when Source Start equals Stretch Start and Source End equals Stretch End, your animations will be evenly stretched across the length of your clip in the Edit timeline.

All obviously designed to facilitate lower third templates and other titles.

Add KeyframeStretcher just before your MediaOut node.

Hope this helps to clarify. No need to start messing with expressions or anything. One thing to note is that KeyframeStretcher may get wonky when you're shortening clips, rather than stretching them.

I'll make sure this topic appears in the Resolve for Fusion forum as well...
Go to full post
You do not have the required permissions to view the files attached to this post.

User avatar
SecondMan
Site Admin
Posts: 3678
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 6
Location: Vancouver, Canada
Been thanked: 125 times
Contact:

Re: Keyframes: stretch to fit

#2

Post by SecondMan » Sat Nov 09, 2019 6:26 pm

Welcome to WSL!

Isn't what you describe in a nutshell what KeyframeStretcher is for?

User avatar
brysend
Posts: 4
Joined: Sat Nov 09, 2019 6:04 pm

Re: Keyframes: stretch to fit

#3

Post by brysend » Sat Nov 09, 2019 7:10 pm

SecondMan, thank you so much for the suggestion. The resolve manual has zero information on it, and how to use it.
I played around with it, to no avail. Not sure how to modify the Stretcher's parameter to make it work.

1. I played with Source Start, End, Stretch Start and Stretch End but didn't have much success. They don't seem to affect the keyframes, probably because I am putting in wrong values as params for the KSfx

Seems very helpful, just not sure how to use it. How can I calculate the appropriate Source Start, End, and Stretch Start, End ?
Screen Shot 2019-11-09 at 7.13.05 PM.png

Also I noticed other animations that are responsive have these arrows going left and right of the Keyframes, how can i add these arrows in my Nodes ?
Screen Shot 2019-11-09 at 11.43.27 PM.png
You do not have the required permissions to view the files attached to this post.

User avatar
SecondMan
Site Admin
Posts: 3678
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 6
Location: Vancouver, Canada
Been thanked: 125 times
Contact:

Re: Keyframes: stretch to fit

#4

Post by SecondMan » Sun Nov 10, 2019 12:55 am

In DaVinci Resolve, KeyframeStretcher is supposed to work in conjunction with Resolve's Edit page.

You can figure out the way it works more easily in Fusion Standalone, where you have direct control over the comp's GlobalStart and GlobalEnd, which in Resolve are determined by the Edit timeline (not sure if I describe this 100% correctly).

KeyframeStretcher.PNG

Essentially what it does in Resolve is the following. It scales (time-stretches) whatever is inbetween Source Start and Source End to the length of the clip in the timeline.

The Stretch Start and Stretch End determine which part of the source is being stretched, and which is untouched.

In the default example above, the source timing of anything between frames 0 and 24, and anything between frames 96 and 120 will remain unaffected, but if the clip in the timeline is longer than 120 frames, anything between 24 and 96 will be stretched.

When Stretch Edges Instead is checked, the source timing of anything between frames 0 and 24, and anything between frames 96 and 120 will stretch, but anything between 24 and 96 will remain unaffected.

Consequently, when Source Start equals Stretch Start and Source End equals Stretch End, your animations will be evenly stretched across the length of your clip in the Edit timeline.

All obviously designed to facilitate lower third templates and other titles.

Add KeyframeStretcher just before your MediaOut node.

Hope this helps to clarify. No need to start messing with expressions or anything. One thing to note is that KeyframeStretcher may get wonky when you're shortening clips, rather than stretching them.

I'll make sure this topic appears in the Resolve for Fusion forum as well...
You do not have the required permissions to view the files attached to this post.

User avatar
brysend
Posts: 4
Joined: Sat Nov 09, 2019 6:04 pm

Re: Keyframes: stretch to fit

#5

Post by brysend » Sun Nov 10, 2019 7:57 pm

Thank you for providing such a detailed and helpful description of the params and the connection between fusion and resolve.
I have a much better understanding now!

- After adding keyframe stretcher and adjusting it's params
- After setting the same time for `Source Start` to `Stretch Start` and `Source End` to `Stretch End`. I am getting errors:

  1. MediaIn1_1 cannot get frame for time 15
  2. ChannelBooleans1_1 cannot get Parameter for Background at time 15.9091
  3. KeyframeStretcher1 cannot get Parameter for Keyframes at time 15.9091
  4. MediaOut1 cannot get Parameter for Input at time 16
  5. MediaOut1 failed at time 16
________________________________________

My comp is 32 frames long, but all my keyframes are within 13 and 19, so that's the value I set for Source Start/Stretch and Source End/Stretch
Screen Shot 2019-11-10 at 7.54.53 PM.png


Any clues what could be causing this ? Also the nodes turn red, when adding KeyframeStretcher node with param.
Screen Shot 2019-11-10 at 7.56.36 PM.png
You do not have the required permissions to view the files attached to this post.

User avatar
SecondMan
Site Admin
Posts: 3678
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 6
Location: Vancouver, Canada
Been thanked: 125 times
Contact:

Re: Keyframes: stretch to fit

#6

Post by SecondMan » Sun Nov 10, 2019 9:44 pm

Any chance you can post your comp?

User avatar
brysend
Posts: 4
Joined: Sat Nov 09, 2019 6:04 pm

Re: Keyframes: stretch to fit

#7

Post by brysend » Mon Nov 11, 2019 6:47 pm

SecondMan wrote:
Sun Nov 10, 2019 9:44 pm
Any chance you can post your comp?
Yes sir, here it is :
Archive.zip
After adding the stretcher, it did not stretch the animation appropriately and left a weird artifact towards the end.
You can simply turn off the stretcher to see how the animation is supposed to look. Thanks for checking it out sir.
You do not have the required permissions to view the files attached to this post.

User avatar
Pekkaman
Posts: 4
Joined: Wed Oct 09, 2019 1:37 am

Re: Keyframes: stretch to fit

#8

Post by Pekkaman » Tue Nov 12, 2019 3:50 am

I raised the same point before in the group in another thread...but ive not been able to get a solution just yet.!! ill be following this thread if you there will be some luck with it. p.s i also tried using the keyframestretcher but it seems it does not affect some parameters as it concerns using the adjustment layer . Could it be a blackmagic issue to resolve ?

User avatar
ShadowMaker SdR
Fusionista
Posts: 675
Joined: Sun Sep 21, 2014 6:17 am
Answers: 4
Been thanked: 22 times

Re: Keyframes: stretch to fit

#9

Post by ShadowMaker SdR » Tue Nov 12, 2019 7:41 am

I think you should stay away from adjustment layers in combination with the Fusion page. I have the feeling that they're not really compatible at the moment.
Honestly I have no idea how they are supposed to work inside of Resolve, so this might be just me.