Copy link to clipboard
Copied
I was wondering if it's possible to create a stop/smooth ending to a LoopOut expression on Rotation and Position keyframes. I am currently using OSX 10.9.3 After Effects CS6 and I have tried a couple of things that haven't worked for me.
adding a checkbox expression control to the layer and an expression for loopOut()
if (effect("Checkbox Control")("Checkbox")==true){
loopOut();
}else{
value;
}
loopOutDuration(“cycle”,2)
Unfortunately neither of these seems to work. I was wondering if someone had a solution they have come across.
Thanks very much
Ira
Copy link to clipboard
Copied
You could play around with something like this:
cb = effect("Checkbox Control")("Checkbox");
if (cb.value == true)
t = time%key(numKeys).time
else if (cb.numKeys > 0)
t = cb.key(cb.numKeys).time%key(numKeys).time
else
t = 0;
valueAtTime(t)
It assumes your checkbox is keyframed to go from on to off (only once) and will hold the rotation value at that time.
Dan
Copy link to clipboard
Copied
Thank you Dan, I apologize for not thanking you sooner. I also came across this expression which decelerates the loop.
When you paste a path into the Position property, you should get a two-second animation. You can then add a slider and keyframe it to control the speed. A slider value of 1 will keep the loop at 2 seconds, a value of 2 will make it twice as fast, 0.5 half as fast, etc. Then use this expression instead of your loopOut() expression:
spd = effect("Slider Control")("Slider"); n = spd.numKeys; if (n > 0 && spd.key(1).time < time){ accum = spd.key(1).value*(spd.key(1).time - inPoint); for (i = 2; i <= n; i++){ if (spd.key(i).time > time) break; k1 = spd.key(i-1); k2 = spd.key(i); accum += (k1.value + k2.value)*(k2.time - k1.time)/2; } accum += (spd.value + spd.key(i-1).value)*(time - spd.key(i-1).time)/2; }else{ accum = spd.value*(time - inPoint); } if (numKeys > 1){ d = key(numKeys).time - key(1).time; t = (accum - key(1).time)%d; valueAtTime (key(1).time + t); }else value
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more