ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

x rotation delay

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
robert trione
x rotation delay
on Nov 25, 2008 at 11:17:00 pm

strt = 0; //start time of template motion
end = 4.0; //end time of template motion

t = thisComp.layer("template");
offset = (t.effect("offset")("Slider")/100)*(index -1);
travel = linear(t.effect("travel")("Slider")/100,strt,end);

u = t.toWorldVec([1,0,0],travel - offset);
v = t.toWorldVec([0,1,0],travel - offset);
w = t.toWorldVec([0,0,1],travel - offset);

sinb = clamp(w[0],-1,1);
b = Math.asin(sinb/thisComp.pixelAspect);
cosb = Math.cos(b);
if (Math.abs(cosb) > .0005){
c = -Math.atan2(v[0],u[0]);
a = -Math.atan2(w[1],w[2]);
}else{
a = Math.atan2(u[1],v[1]);
c = 0;
}
[radiansToDegrees(a),radiansToDegrees(b),radiansToDegrees(c)]


I have worked with delay expressions several times. The past couple of times I have been wanting to add a delay to the x rotation. I have looked at Dan Ebberts's website and I found an expression that works with delaying the z rotation. http://www.motionscript.com/mastering-expressions/follow-the-leader.html I have no idea if I should try to use the expression as a jumping point...if so I actually have no idea how to change it. I added Dan Ebberts's expression, but you might want to visit the site in order to see how he was using it.

Thank you so much for your help,

Robby Trione
http://www.brainfarmproduction.com


Return to posts index

Dan Ebberts
Re: x rotation delay
on Nov 26, 2008 at 4:06:59 pm

You're probably looking for something more like this:

delay = 5; //number of frames to delay

d = delay*thisComp.frameDuration*(index - 1);
thisComp.layer(1).transform.xRotation.valueAtTime(time - d)



Dan



Return to posts index

robert trione
Re: x rotation delay
on Nov 26, 2008 at 5:28:21 pm

Thanks, Dan. I actually tried that expression first. Every time I used that expression I got an error message:

After Effects warning: Class 'Group' has no property or method named 'xRotation' Expression disabled.

After you suggested to use it again...I tried the expression without a null layer and it worked fine. I then added a null and it stopped working. Then I moved the null from the top layer to the last layer and turned the expression back on and it worked. I guess the whole null thing is what got me so discouraged.

Thank you for your help,

Robby Trione
http://www.brainfarmproduction.com



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]