-
Straight line ease into Math.sin/cos
Consider the following position orbit expression:
My question, how can I have this layer start from comp center and smoothly move into it’s position in the orbit over the course of n frames, starting at the layer’s inPoint?
I think my biggest hang-up is that each layer that this expression is applied to has a slightly different position value at n time, and I’m unsure of how to grab the Math.sin/cos value at that specific time (if that’s even part of the method)
oSpeed = thisComp.layer("orbitController").effect("orbitSpeed")("Slider");
oWidth = thisComp.layer("orbitController").effect("orbitWidth")("Slider");
oHeight = thisComp.layer("orbitController").effect("orbitHeight")("Slider");
off = thisComp.layer("orbitController").effect("offset")("Slider");
i = thisLayer.index;
o = i*off;
t = framesToTime(1)*o;
x = Math.sin((time+t)*oSpeed)*oWidth;
y = Math.cos((time+t)*oSpeed)*oHeight;
[value[0]+x,thisComp.layer("orbitController").effect("yOrigin")("Slider")+y]