5 Replies Latest reply on Jul 15, 2017 12:46 AM by Roei Tzoref

# Counting frames between keyframes

Besides looking at the timecode and dragging from one keyframe to another and doing math, is there another way to determine how long a keyframes animation takes place over?

• ###### 1. Re: Counting frames between keyframes

it's possible to write an expression that would measure the distance between the previous keyframe and next keyframe on the same property. but you'd have to do this per property.

• ###### 2. Re: Counting frames between keyframes

highlight one keyframe, alt+click on the other and look on the info panel

note: make sure the CTI is NOT right on the keyframe you are alt+clicking...

• ###### 3. Re: Counting frames between keyframes

I tried this and the results do not seem correct, sometimes I get values and sometimes I do not and i have to do it multiple times to get results. When I do, I click the first keyframe and alt+click the next, the CTI is not on the keyframes I am clicking on, and I get -0;00;00;25 (what is the negative for?) I click off the keyframes and onto the timeline to deselect them, and I drag the second keyframe to the right a few frames and I do the alt+clicking again and now it displays 0;00;00;03 I only dragged a few frames to the right so, unless I am completely misunderstanding this, I'd think it would read something more like -0;00;00;28

Why does it displays these values?

Thanks

• ###### 4. Re: Counting frames between keyframes

If the second keyframe you click on is to the left then the value is negative and you get the minus sigh. If the second keyframe you click on is to the right you get a positive number. It makes perfect sense to me.

Results are predictable and repeatable if you hold down the Alt/Option key and click on the first one then click on the second keyframe. Sometimes if you highlight a keyframe first and then Alt/Option click on the second one you get the time value for the second keyframe instead of the difference between them.

Also, if the time indicator is set to frames you get frames. If it is set to timecode you get time and some times it's hard to read time and subtract it in your head especially if you are using drop-frame timecode. 99% of my projects are in frames because 99% of my AE work is on a shot and not on something I'm editing because AE is a lousy editor. I'll cut to time in PPro.

A fairly simple expression could be written and applied to the Source Text of a text layer but you would have to declare the layer and the property you wanted to look at every time. If you wanted to check just the time between something like position property on a layer you could use index + 1 to define the layer and then just drag the text layer above the layer you wanted to check. This would save you entering the layer name every time you wanted to check the time between keyframes. It's been a long day so I won't try and write the expression but the logic is this:

p = thisComp.layer( index + 1).transform.position; // looks at the position property of the layer below

Now you would just call out the time value of the previous and next keyframe and then subtract the previous one from the next one. That call would be based on the position of the CTI so you would get a number when th eCTI was between two position keyframes.