ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Hold Time Between Keyframes

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Marlon Brown
Hold Time Between Keyframes
on Jul 3, 2018 at 9:26:01 pm

I'm trying to write and expression that allows you to control the hold time between hold keyframes with sliders. There are 4 holds: Keyframes 2-3, 5-6, 8-9, and 11-12. I would like each hold to be controlled by its own slider, 4 sliders in total. I started below, but I don't know if I'm heading in the right direction.

Thanks!

holdTime = thisComp.layer("control").effect("hold")("Slider")
k1 = 2; // 1st hold keyframe
k2 = 3; // 2nd hold keyframe
k3 = 5; // 3rd hold keyframe
k4 = 6; // 4th hold keyframe
k5 = 8; // 5th hold keyframe
k6 = 9; // 6th hold keyframe
k7 = 11; // 7th hold keyframe
k8 = 12; // 8th hold keyframe

p = timeRemap
t1 = p.key(k1).time;
t2 = t1 + holdTime -1.5;

if (time &lt; t1)
t = time
else if (time &lt; t2)
t = linear(time,t1,t2,t1,p.key(k2).time)
else
t = p.key(k2).time + (time - t2);
valueAtTime(t)


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]