Eduardo Oliveira
Forum Replies Created
-
Eduardo Oliveira
February 28, 2016 at 12:08 pm in reply to: Get the time value when a variable changes.Unfortunately at the moment after effects is unable to store variables. you can sample a value from the past, but not store values for posterior use ( the expression will re-run every frame, clearing any stored values again)
you can, however, use the key(n).time as a switch.. or the element position value as a threshold -
Eduardo Oliveira
February 28, 2016 at 11:32 am in reply to: Auto secondary movement (inertia/overshoot) in children layerschanging the “v” variable might give you wrong/weird results..
try changing the “parv” variable instead to below: ( although 20 is a bit overkill)
although in my opinion the best way to simulate wheight is the freq variable. heavier items should just have lower values.
i haven’t tested this tweak, se let me know if it works 🙂
parv=clamp(ppos.velocityAtTime(time- thisComp.frameDuration*20)[0]*amp,-90,90) -
Eduardo Oliveira
February 26, 2016 at 2:54 pm in reply to: Auto secondary movement (inertia/overshoot) in children layersPs: the “serious math” wasn’t figured out by myself too 🙂
I took the famous Inertia bounce expression ( I think it was made by Dan Ebberts, orinally)
and just modified to suit your needs 🙂Glad to be of help!
-
Eduardo Oliveira
February 26, 2016 at 2:45 pm in reply to: Auto secondary movement (inertia/overshoot) in children layersforgot to say: you can adjust the parameteres to make small differences:
amp = this is how much of an overshoot will happen (higher = stronger)
freq= frequency of the swings ( higher = quicker swings)
and decay = how long before they come to a stop (higher = stops faster)by tweaking those three you should be able to add enough variance.. also i made a slight tweak:
here is the revised one. let me know if it works well//inertial children
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
February 25, 2016 at 12:49 pm in reply to: Updating loads of pointers in expressionswith a little bit of manual work, you can do it.
first, move the controller null inside the comp with the solids.
now the manual labor part = relink the solids to the null inside the same compthen duplicate the controller null onto the comp wich will be having the controllers.
make the original null(inside the comp with the solids) get all the relevant stuff from the one outside that comp.now, when you duplicate the comp with the solids, all you have to do is change the target of the controlling null inside that comp….
sorry, i know that still involves a lot of manual changes – but at least if you need to replicate that a few times, it will save you some work
-
Eduardo Oliveira
February 24, 2016 at 10:07 pm in reply to: Auto secondary movement (inertia/overshoot) in children layersi think i got something here:
i did it only considering lateral movement, so you wouldnt see any inertial rotation for y axis movements.
but it works well with dangling things…
here is the code://inertial children
n = 0;
amp = .04;
freq = 2.0;
decay = 3.0;ppos=thisLayer.parent.transform.position;
parv=clamp(ppos.velocity[0]/10,-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
}
-
forgot to say – drop this in the “brightness” property of the optical flares layer
-
hey, this seems to work:
change the “target” to your null
adjust the power variable to suit your needs.target=thisComp.layer("Null 1");
power=10;
curv=target.transform.position[1];
oldv=target.transform.position.valueAtTime(time-0.1)[1];
v=oldv-curv;
v*power -
Eduardo Oliveira
February 24, 2016 at 7:01 pm in reply to: “Inertial Bounce” expression in text layeri really wish there was and EDIT button in this forum… hehehe.
anyways, probably very few people are even using these expressions, but after making a fool of myself twice, i realized that my fixes were false positives. anyways, i’ve spend a couple of hours, and i am almost sure that this time it works flawlessly. anyways, feel free to point out to me if it does not work for you.
as always, the expression goes in the “amount” field, not on the property used on the animator.here it is:
//Inertia Bounce for TEXT per CHARACTER ANIMATION!delay = .1;
tDelay = delay*textIndex;
n = 0;
if (numKeys > 0){
n = nearestKey(time-tDelay).index;
if (key(n).time > time-tDelay) n--;
}
if (n == 0){
t = 0;
}else{
t = time - key(n).time - tDelay;
}if (n > 0){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
amp = .05;
freq = 2.0;
decay = 2.0;
valueAtTime(time-tDelay) + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
valueAtTime(time-tDelay);
}
-
Eduardo Oliveira
February 24, 2016 at 6:58 pm in reply to: Updating loads of pointers in expressionsseems to me that if you just rename the layer “control green y” to “control green x” and delete the old one/rename it, then they would automatically point to the new one… am i wrong?