Forum Replies Created
-
Jake Dickey
April 26, 2016 at 3:11 pm in reply to: Auto secondary movement (inertia/overshoot) in children layersLike a boss! Thank you! This has been really helpful in learning how to reference other layers’ properties properly. I was actually able to figure out how to make it work on an older version of the classic “bounce” expression BEFORE someone added in the amp variable,
freq = 3;
decay = 5;ppos=thisLayer.parent.transform.position;
n = 0;
if (ppos.numKeys > 0){
n = ppos.nearestKey(time).index;
if (ppos.key(n).time > time) n--;
}
if (n > 0){
t = time - ppos.key(n).time;
amp = ppos.velocityAtTime(ppos.key(n).time - .001);
w = freq*Math.PI*2;
value + amp*(Math.sin(t*w)/Math.exp(decay*t)/w);
}else
value…but I couldn’t figure out how to make it work on the version of the expression that I had WITH the amp variable. Thanks for letting me pick your brain a bit!
-
Jake Dickey
April 26, 2016 at 2:44 pm in reply to: Auto secondary movement (inertia/overshoot) in children layersOh crap. So, this works great on the x axis, but it doesn’t do anything on the y axis. I don’t understand the code well enough to understand why. Any ideas on getting this code to work in both (or even 3) axis simultaneously?
-
Jake Dickey
April 26, 2016 at 2:41 pm in reply to: Auto secondary movement (inertia/overshoot) in children layersFair enough. I will probably leave it in anyway so that it is easier for me to remember what value to change if I DO want a collision type bounce.
-
Jake Dickey
April 26, 2016 at 1:48 pm in reply to: Auto secondary movement (inertia/overshoot) in children layersJust as a side note, I modified this line:
v = ppos.velocityAtTime(ppos.key(n).time - thisComp.frameDuration/10)*-1;to…
v = ppos.velocityAtTime(ppos.key(n).time - thisComp.frameDuration/10)*1;By changing the -1 at the end to a positive value, that got things closer to what I needed. It seems with a negative value, the velocity curve (and bounce response) is more like its falling at a constant speed and bouncing off of a hard surface like a rubber ball when it reaches the end position–at least, on the first bounce. With a positive value, it seems to let the children follow through past the end position, dissipating their “inertia” on the other side of the axis, like they are buoyant objects that fell into water, or like the children are tethered to the parent via loose springs on an imaginary Z axis.
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
} -
Jake Dickey
April 26, 2016 at 1:01 pm in reply to: Auto secondary movement (inertia/overshoot) in children layersYes, indeed it did! Looking over the code, I can sort of see what I was doing wrong with my attempts. I understand the flow and logic of it, I just don’t understand the correct “grammar” of AE Java when it goes beyond just referencing the layer where the code originated–and I stumble my way through that anyhow. Thank you!
-
Jake Dickey
April 26, 2016 at 2:02 am in reply to: Auto secondary movement (inertia/overshoot) in children layersRE:Rotation
Ah, that’s what I was afraid of. I’m looking for a way to attach a lot of objects to a null, or other parent object, and I want them to have inertial bounce based on the movement of the null. Kind of the same idea add what you have here, but instead of rotational manifestation, I just need good old fashioned directional inertial bounce, for lots of objects all tied to one parent.
-
Jake Dickey
April 25, 2016 at 10:59 pm in reply to: Auto secondary movement (inertia/overshoot) in children layersAck… Several hours spent trying to figure this out so far, but it’s time to ask: How do I make this work!?
I’ve been applying this expression to the position field, with an error message popping up saying “expression result must be of dimension 2, not 1.”
You said something about this code being more for “x” motion, such as for dangling objects, so I tried separating the x,y dimensions of the parent and child objects involved, but I’m not getting any kind of desirable results. There’s not error messages, but the child layer isn’t bouncing at all. It’s just nudging the landing position of the layer.
Anyway, I’m moderately used to using basic expressions, but I’m feeling really dumb for not being able to figure this out. Can you explain exactly where I should be trying to apply this expression for it to work properly?
Do you have any ideas for a more general/universal “parental inertial bounce” expression that can be used directly on the “position”?