Page 1 of 1

Expressions for keyframe/timeline control?

PostPosted: Wed Oct 09, 2019 2:15 pm
by Scott_Roby
Hi all,

I have four objects I want to animate. Each object will share the same animation path.

I've keyframed the movement on a custom tool, then used expressions to connect each of the four object to that movement. I did this so I won't have to keep track of four separate sets of keyframes.

All four objects now move as a group. Awesome.

But I want to offset the beginning of the movement for each object; each should start six frames after the previous object starts its movement.

Is there an expression I can use to accomplish this offset?

Should I ditch the custom tool?

Thanks!

Re: Expressions for keyframe/timeline control?

PostPosted: Wed Oct 09, 2019 2:29 pm
by Sander de Regt
Definitely ditch the custom tool. Just make one animation the way you want it and then modify the other centers with off-set modifiers. You can off-set in space and in time with these.

Re: Expressions for keyframe/timeline control?

PostPosted: Wed Oct 09, 2019 2:31 pm
by Scott_Roby
Thanks! Going to try that right now.

Sander de Regt wrote:Definitely ditch the custom tool. Just make one animation the way you want it and then modify the other centers with off-set modifiers. You can off-set in space and in time with these.

Re: Expressions for keyframe/timeline control?

PostPosted: Wed Oct 09, 2019 2:33 pm
by Bryan Ray
Instead of reading the value directly, there is a GetValue() function that can read it from a different time. Documented in the old VFXPedia here:
https://www.steakunderwater.com/VFXPedi ... _.2F_frame

Instead of adding a constant to time, you could add the results of another slider, allowing you to adjust the time offset easily.

…I see Sander ninja'd me. His solution is probably better in most cases, but I can see where your expression-linking method could also be useful, so if you want to stick with it, the above might be helpful.

Re: Expressions for keyframe/timeline control?

PostPosted: Wed Oct 09, 2019 3:29 pm
by Scott_Roby
Thanks for the speedy replies, but it seems I'm already out of my depth.
I might need a little more hand-holding.
Please see the attached screengrabs.

The goal: Animate each of the four boards, beginning with the left small board.
I created a transform node (Ten_xform), animated the position. (y position from -0.5 to 0.5 over 15 frames)

Created a tandsform node for the second board (Twelve_xform) and modifies the center with an expression (see Modify Two grab).

Do I now right-click and choose modify with Offset Position, then choose the time controls?

Re: Expressions for keyframe/timeline control?

PostPosted: Wed Oct 09, 2019 5:41 pm
by Sander de Regt
For simple operations like this you don't need the expression. Just use the off-set modifier straight away. You're almost there.

Re: Expressions for keyframe/timeline control?

PostPosted: Wed Oct 09, 2019 7:42 pm
by Scott_Roby
Thanks!

Each of the separate objects will each need a transform node , yes?
And the offset modifiers are activated on those transform nodes?

Re: Expressions for keyframe/timeline control?

PostPosted: Wed Oct 09, 2019 7:49 pm
by Sander de Regt
Yup. That's it.

Re: Expressions for keyframe/timeline control?

PostPosted: Wed Oct 09, 2019 7:57 pm
by Scott_Roby
It works!

I realized the mistakes I was making earlier.

I appreciate the help and guidance.

This is working EXACTLY as I hoped, while keeping the amount of keyframes and splines to a minimum.