ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Offshoot without keyframes

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Håkon Lund
Offshoot without keyframes
on Feb 20, 2017 at 12:12:25 pm


I have a character with a tie (separate layer) around his neck, and I've used a simple expression (value - thisComp.layer("torso").transform.rotation) to invert it's rotation from the rotation of it's parent layer (torso). It works pretty good when I animate the rotation of the torso with keyframes.

But ideally I would like to add some offshoot to the tie. But most of the current offshoot animations are based on keyframe information.

In short: Is there a way to add offshoot to the rotation of a layer when it gets it rotation information from another layer?

Best regards Håkon

value - thisComp.layer("torso").transform.rotation

Return to posts index

Dan Ebberts
Re: Offshoot without keyframes
on Feb 20, 2017 at 9:06:29 pm

If the torso rotation is keyframed, something like this might work:

r = thisComp.layer("torso").transform.rotation;
freq = 3;
decay = 5;
n = 0;
if (r.numKeys > 0){
n = r.nearestKey(time).index;
if (r.key(n).time > time) n--;
if (n > 0){
t = time - r.key(n).time;
amp = r.velocityAtTime(r.key(n).time - .001);
w = freq*Math.PI*2;
value -r - amp*(Math.sin(t*w)/Math.exp(decay*t)/w);
value - r


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved