ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Re: loopOut - How to set how many loops I want, then stop?

COW Forums : Adobe After Effects Expressions

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Respond to this post   •   Return to posts index   •   Read entire thread


Elad Menashe
Re: loopOut - How to set how many loops I want, then stop?
on Nov 6, 2012 at 8:52:31 am

The attached code works on position property, you will need to change it in case a different property is desired.
The number of loops is set by the loops variable.

Note: the actual property change done via keyframes is considered as the first loop.

Elad

loops = 5;
FirstKeyFrameTime = thisComp.layer(index).position.key(1).time;
LastKeyFrameTime = thisComp.layer(index).position.key(numKeys).time;
if (time < (loops * (LastKeyFrameTime - FirstKeyFrameTime))) {
loopOut(type = "cycle", numKeyframes = 2)
}
else {
position.valueAtTime(LastKeyFrameTime )
}



Posts IndexRead Thread 


Current Message Thread:





© 2020 CreativeCOW.net All Rights Reserved
[TOP]