Time offset from keyframes

Moderators: Disciple, zlovatt

Post Reply
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

I'm trying to build a dumbed down control set for people to use. The project has a bunch of transitions that need to be customized by the editor. They need to be able to adjust when each transition happens in the composition. The tranny's involve wiping off and on different layers. I would like to do this without scripting if possible.

Here's my question:
Can you get a keyframe time value through expressions? The idea would be that someone could shift keyframes around and it would adjust the timing of a precomp matte based on the location of the keyframe in the timeline.
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

Yes, if you mean the time that a keyframe occurs. Here's an example getting the time of the first position keyframe:

t = position.key(1).time;

Is that what you meant?

Dan
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

That looks like what I need, I'll test it monday. Thanks Dan.
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

I'm using this technique to offset some keyframes in a precomp with a marker in the main comp. I'm having a devil of a time getting the offset figured out. When you use .speedAtTime() from another comp what value does that return into the precomp? Below is a picture of what I'm doing. I want to be able to drag a marker around in the main comp and have it adjust the timing of the animation in the precomp.


Image
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

Byron,

I'm not sure exactly what you're trying to do. Do you want the animation in the precomp to start at the time where the marker is in the main comp?
If so, you need to calculate your offset based on the difference between the time of the first keyframe (comp("Main Comp").layer("Null 1").position.key(1).time) and the time of the marker.

The speed value is the scalar component of the Position velocity vector. So in your case it's the absolute magnitude (in pixels per second) of Null 1's motion, irrespective of direction.

Dan
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

I like to use the interpolation functions to link one main animated property, position in this case, to several other properties. The reason I did not use the keyframe time is because the project I was trying this in had a multitude of keyframes and several precomps all referencing the main Null. I was adding and shifting keyframes a lot on the master Null so that would have messed up my expression. What I wanted to do was be able to drag that marker and make that be the start of the animation on the expression. Most of the time it lined up with a keyframe, but sometimes it needed to be offset. To further complicate things, most of the layers had to be trimmed at the front. I think I solved that by using startTime instead of inPoint.

I hope that makes some sense.
Post Reply