Activity › Forums › Adobe After Effects Expressions › controlling keyframes
-
controlling keyframes
Posted by Shahed Naderi on May 21, 2014 at 10:56 pmhello
I have a bunch of keyframes that drives an animation , I need to control the begging of it. tell it when to begins in seconds by using an slider control.
anyone can help with that expression ?Shahed Naderi replied 12 years, 3 months ago 2 Members · 4 Replies -
4 Replies
-
Darby Edelen
May 22, 2014 at 3:08 amSomething like this should work:
firstKey = key(1).time;
offset = effect("Slider Control")("Slider");
valueAtTime(time + firstKey - offset);Although that will return an error if the property doesn’t have at least 1 keyframe. A try/catch statement could be used to prevent that error:
try{
firstKey = key(1).time;
offset = effect("Slider Control")("Slider");
valueAtTime(time + firstKey - offset);
}
catch(err){
value;
}Darby Edelen
-
Shahed Naderi
May 22, 2014 at 8:07 amthat’s working just fine , thank you bro , but what if you have a comped animation – for instance 2 seconds- and you want to offset and play it with expression through the time line ? I mean control the beginning with a slider on another layer.
is it possible ? -
Darby Edelen
May 22, 2014 at 3:56 pmTime remapping is the easiest way to do something like that. In that case an expression would be optional depending on how you want it set up.
Darby Edelen
Reply to this Discussion! Login or Sign Up