-
another butterfly expression question
Hi all.
I’m relatively new to expressions but an intermediate-advanced after effects user. I’ve dug through creative cows, Dan Ebbert’s motionscript, and other sites to find a solution but haven’t found one. Appologies for reposting something thats got a lot of responses already, but i appreciate everyone’s input 🙂
I am making a large group of butterflies go from dormant (wings breathing slowly) to them all flying in a group over a matter of ~3 seconds.
I am trying to use sliders to automate:
1. how quick the wings flap
2. the range of motion they moveWith these two controls i figure it would be easy to set a dormant state with the wings open but moving slowly (ie: slow flap, 10deg range), then ease out of that to a fast, full flight lifespan.
I dont know math well enough to figure this out, but when i run the code below (easing from a relaxed state to fast frequency/large amplitude) the wings go VERY fast while ramping up, then settle at the desired pace.
freq = thisComp.layer("Null: Angle Wing Slider").effect("Frequency Slider")("Slider");
amplitude = thisComp.layer("Null: Angle Wing Slider").effect("Amplitude Slider")("Slider");
decay = 0; //no decayamplitude*Math.sin(freq*time*2*Math.PI)
What do i modify to allow it to operate smoothly?
Thanks!
—————————————————–
Originally i had wanted to use this code (dan’s) but couldn’t make sense of how to get the last 2 lines to work:
from = -45; //one end of your oscillation
to = 45; //the other end of your oscillation
period = 1.5; //time between oscillation points (multiply by 2 for a round trip)
t = time % (period * 2);
if (t > period) t = 2 * period – t;
linear(t, 0, period, from, to)jay
