Camera expression: delay time at each key frame?

Moderators: Disciple, zlovatt

Post Reply
mooter
Posts: 5
Joined: October 24th, 2004, 12:24 pm

I have the general idea, but not the correct syntax to do it.

Basically what I'm doing now is setting key frames of camera positions through time without having pauses, I figure I can set an expression later to set the pause a certain number of seconds at each leyframe.

How so?
Mylenium
Posts: 139
Joined: July 20th, 2005, 12:07 am

mooter wrote:I have the general idea, but not the correct syntax to do it.

Basically what I'm doing now is setting key frames of camera positions through time without having pauses, I figure I can set an expression later to set the pause a certain number of seconds at each leyframe.

How so?
I think you are overcomplicating things. It would be much easier to copy your keyframes or insert new ones into an existing animation using the keyframe checkbox in the timeline to get the behavior you want. I'm not saying it can't be done with expressions, but it just does not seem feasible - manipulating time is one of the more tricky parts and it may not be worthwile to spend hours on writing na expressions if you can do the same thing in a few minutes by hand.

Mylenium
[Pour Mylène, ange sur terre]
mooter
Posts: 5
Joined: October 24th, 2004, 12:24 pm

Well, I haven't spent hours. I WOULD IF I tried. But thats the whole point of this place, where theres someone who knows how easy it is. The fact it might be, I'll do research. It isn't just to do this for the project, but to understand expressions.
Mylenium
Posts: 139
Joined: July 20th, 2005, 12:07 am

mooter wrote:Well, I haven't spent hours. I WOULD IF I tried. But thats the whole point of this place, where theres someone who knows how easy it is. The fact it might be, I'll do research. It isn't just to do this for the project, but to understand expressions.
Well, then you should start with something simpler. The problem with the type of expression you want is that it's not too difficult to get the "hold" behavior but to smoothly blend back to the original animation - that's not easy, not even for someone who's halfway proficient with expressions/ scripts. Please forgive my saying so, but you should not expect expressions/ scripts to do any magic - they just refer to functions that After Effects uses anyway. And like I said, in your case it's simply not the most efficient way to do things, you should investigate other methods first.

Mylenium
[Pour Mylène, ange sur terre]
mooter
Posts: 5
Joined: October 24th, 2004, 12:24 pm

I'll take your word for it:)
davestewart
Posts: 114
Joined: March 10th, 2005, 5:50 am
Location: London, UK
Contact:

Mooter,
If I understand your question, what you want is to just expand (in time) your initial few keyframes to simulate a hold effect. If you want the hodl for each frame to be the same amount of time, it's fairly easy.

Set your key frames, then ALT-Click the Stopwatch Icon and paste in this expression:

Code: Select all

hold=2;
v=1/thisComp.frameDuration;
posterizeTime(1/hold);
position.valueAtTime(time/v);
Hold is the time (in seconds) for how long you want each keyframe (assuming you set a keyframe at each frame) to last.

You can click the stopwatch to temporarily disbale and enable the expression if you need to set more keys.

However, Myleenium is right - this could be a limiting way to do things. For example, in this case (unless you play with the algorithm) it is limited to set periods.

Cheers.
mooter
Posts: 5
Joined: October 24th, 2004, 12:24 pm

Thanks:)

That's close. What that does is hold time BETWEEN keyframes, (kind of a stutter, hard to explain)
while the idea was to pause at EACH keyframe.

Nonetheless, I appreciate the note and yes, the easy way is to copy the key frames and paste them apart from each other some number of frames.
Post Reply