Eduardo Oliveira
Forum Replies Created
-
Eduardo Oliveira
August 9, 2020 at 1:21 pm in reply to: Auto secondary movement (inertia/overshoot) in children layersHey Ricardo, how are you controlling the hair at the moment? is it on puppet pins? or jsut a layer on its own?
-
Eduardo Oliveira
April 27, 2016 at 11:22 am in reply to: Auto secondary movement (inertia/overshoot) in children layersWas glad to help, Guys.
anyways, just for the sake of people that end up on this thread in the future, i’ve collated the most revised versions below, so that people can use the right ones without having to re-read the whole thread.
(these are 2 different expressions, use the one that suits your needs)
//inertial children bounce (apply on "position")
n = 0;
amp = .04;
freq = 2.0;
decay = 3.0;ppos=thisLayer.parent.transform.position;
if (ppos.numKeys > 0){
n = ppos.nearestKey(time).index;
if (ppos.key(n).time > time){
n--;
}
}
if (n == 0){
ppos.velocity
t = 100;
}else{
t = time - ppos.key(n).time;
}if (n > 0){
v = ppos.velocityAtTime(ppos.key(n).time - thisComp.frameDuration/10);value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value
}//inertial children rotation (apply on "rotation", for dagling things like earrings, dreadlocks, pendants etc)
n = 0;
amp = .04;
freq = 2.0;
decay = 3.0;ppos=thisLayer.parent.transform.position;
parv=clamp(ppos.velocity[0]*amp,-90,90)
if (ppos.numKeys > 0){
n = ppos.nearestKey(time).index;
if (ppos.key(n).time > time){
n--;
}
}
if (n == 0){
ppos.velocity[0]
t = 100;
}else{
t = time - ppos.key(n).time;
}if (n > 0){
v = ppos.velocityAtTime(ppos.key(n).time - thisComp.frameDuration/10)*-1;parv + v[0]*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
parv
} -
Eduardo Oliveira
April 26, 2016 at 2:57 pm in reply to: Auto secondary movement (inertia/overshoot) in children layerssorry, i forgot aobut the -1
here is the correct version:
//inertial children bounce
n = 0;
amp = .04;
freq = 2.0;
decay = 3.0;ppos=thisLayer.parent.transform.position;
if (ppos.numKeys > 0){
n = ppos.nearestKey(time).index;
if (ppos.key(n).time > time){
n--;
}
}
if (n == 0){
ppos.velocity
t = 100;
}else{
t = time - ppos.key(n).time;
}if (n > 0){
v = ppos.velocityAtTime(ppos.key(n).time - thisComp.frameDuration/10);value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value
} -
Eduardo Oliveira
April 26, 2016 at 2:56 pm in reply to: Auto secondary movement (inertia/overshoot) in children layerstry this:
//inertial children bounce
n = 0;
amp = .04;
freq = 2.0;
decay = 3.0;ppos=thisLayer.parent.transform.position;
if (ppos.numKeys > 0){
n = ppos.nearestKey(time).index;
if (ppos.key(n).time > time){
n--;
}
}
if (n == 0){
ppos.velocity
t = 100;
}else{
t = time - ppos.key(n).time;
}if (n > 0){
v = ppos.velocityAtTime(ppos.key(n).time - thisComp.frameDuration/10)*-1;value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value
} -
Eduardo Oliveira
April 26, 2016 at 1:53 pm in reply to: Auto secondary movement (inertia/overshoot) in children layerswell spotted. i think this *-1 was still left over from the other expression, and unnecessary for yours. more so, you dont even need to multiply it by 1, as this does absolutely nothing =DDD
below you’ll find those lines revised.
if (n > 0){
v = ppos.velocityAtTime(ppos.key(n).time - thisComp.frameDuration/10);value + v[0]*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value
} -
Eduardo Oliveira
April 26, 2016 at 7:08 am in reply to: Auto secondary movement (inertia/overshoot) in children layersthis last expression that posted should do it! just drop it on the “position”
-
Eduardo Oliveira
April 25, 2016 at 11:43 pm in reply to: Auto secondary movement (inertia/overshoot) in children layersif all you want is postional oveshoot ( like the original bounce), you can try this:
i haven’t got AE open at the moment, so if it does not work let me know.//inertial children bounce
n = 0;
amp = .04;
freq = 2.0;
decay = 3.0;ppos=thisLayer.parent.transform.position;
if (ppos.numKeys > 0){
n = ppos.nearestKey(time).index;
if (ppos.key(n).time > time){
n--;
}
}
if (n == 0){
ppos.velocity[0]
t = 100;
}else{
t = time - ppos.key(n).time;
}if (n > 0){
v = ppos.velocityAtTime(ppos.key(n).time - thisComp.frameDuration/10)*-1;value + v[0]*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value
} -
Eduardo Oliveira
April 25, 2016 at 11:33 pm in reply to: Auto secondary movement (inertia/overshoot) in children layershi Jake,
the message error that you are getting is because the expression outputs a rotation value (one number ) while the position takes two values (x and y)
the expression takes velocity and makes into rotation, so it has to go into the “rotation” property, and causes a inertial rotation, not a “bounce”
what kind of movement are you trying to add to the child layers? -
Eduardo Oliveira
March 8, 2016 at 11:04 am in reply to: Use Accentuated Offset Wiggle Expression to Create Z-depth Rippleyeah, you need a time offset, not multiplying the amount. try using the valueAtTime like this:
value + thisComp.Layer("Audio Amplitude").effect("Both Channels")("Slider").valueAtTime(time - (index-1)/100) -
Eduardo Oliveira
March 8, 2016 at 10:44 am in reply to: Auto secondary movement (inertia/overshoot) in children layersyeah man, keep experimenting! that’s how i lost my fear of expressions :).
an unnecessary idea: you could use the parent’s “y” velocity and use it as a modifier, after the main expression gets calculated, you add/remove a bit of rotation depending on the vertical speed (positive or negative). i have something on my mind already but it would be a cool exercise to fry your brain a little and learn more =)
if you do actually decide do to it, and have any problems, ill be here to help.
All the best!