VideoHive

After effects expresion

117 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Greece
  • Has been a member for 1-2 years
  • Sold between 100 and 1 000 dollars
fAntasticmE says

probably for felt

I want stacked layers to make a “3d text” but i want the rotation to be delayed in each one like a delay effector in cinema. im trying to use
thisComp.layer(index-1).transform.zRotation.valueAtTime(time-5) but doesnt seem to work .any idea? also does this have to be universalized?

4445 posts
  • Elite Author
  • Community Moderator
  • Sold between 50 000 and 100 000 dollars
  • Author had a File in an Envato Bundle
  • Beta Tester
  • Has been a member for 4-5 years
  • United Kingdom
+5 more
felt_tips moderator says

in z rotation

indexOffset = 10; //your first index
iterationOffset = 3; //how many degrees each layer is offset by
value + (thisLayer.index – indexOffset)*iterationOffset;

the way I’ve written it, it’s already universal because it doesn’t refer to any properties.

117 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Greece
  • Has been a member for 1-2 years
  • Sold between 100 and 1 000 dollars
fAntasticmE says

shouldnt i somehow refer to the zrotation of the previews layer? is this done with thisLayer.index?

117 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Greece
  • Has been a member for 1-2 years
  • Sold between 100 and 1 000 dollars
fAntasticmE says

got it .for what it’s worth found a script from Dan Ebberts

//applyTo: position
L = thisComp.layer("leader");
delay = 1.5;
timeToStart = 0;
myDelay = (index-L.index)*delay;
t = time-(timeToStart + myDelay);
if (t > 0){
  delta = L.transform.position.valueAtTime(t) - L.transform.position.valueAtTime(timeToStart);
  value + delta
}else{
  value
}
4445 posts
  • Elite Author
  • Community Moderator
  • Sold between 50 000 and 100 000 dollars
  • Author had a File in an Envato Bundle
  • Beta Tester
  • Has been a member for 4-5 years
  • United Kingdom
+5 more
felt_tips moderator says

got it .for what it’s worth found a script from Dan Ebberts

Oh I see… you want a “follow my leader” expression. Should have read your post more carefully…. didn’t see the bit about the delay effector. Looks like Dan’s expression will do the job nicely then. Just switch out position for rotation.

Note: If you want this to be universal, then you need to refer to properties by their index.

L.tranform.position.valueAtTime(t) becomes L(6)(2).valueAtTime(t);

If you don’t know a property’s index, type the expression thisProperty.propertyIndex and if you need the number of the level above it (i.e. like transform) then use thisProperty.propertyGroup(1).propertyIndex;

Or you could look at Expression Universalizer over at aescripts.com

117 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Greece
  • Has been a member for 1-2 years
  • Sold between 100 and 1 000 dollars
fAntasticmE says

i ve also seen you tut on universal expressions just have to refresh my memory. your script can do the job aswell

117 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Greece
  • Has been a member for 1-2 years
  • Sold between 100 and 1 000 dollars
fAntasticmE says
kept thinking it was to complicated.had to be another way.found this based on what i saw until now.it works
delay=1;
t=time-delay;
temp=thisComp.layer(index-1).transform.zRotation.valueAtTime(t);
if(t>0)
{
value=temp;
}
219 posts
  • Bought between 50 and 99 items
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 100 and 199 users
  • Sold between 5 000 and 10 000 dollars
  • United States
VinhSonNguyen says

Pretty useful expressions, thanks guys!

4445 posts
  • Elite Author
  • Community Moderator
  • Sold between 50 000 and 100 000 dollars
  • Author had a File in an Envato Bundle
  • Beta Tester
  • Has been a member for 4-5 years
  • United Kingdom
+5 more
felt_tips moderator says

kept thinking it was to complicated.had to be another way.found this based on what i saw until now.it works
delay=1;
t=time-delay;
temp=thisComp.layer(index-1).transform.zRotation.valueAtTime(t);
if(t>0)
{
value=temp;
}

You could shorten it further.

(t>0) ? thisComp.layer(index-1)(6)(10).valueAtTime(time-1):value;

:)

But I would get into the habit of putting your layer ref into a variable like Dan does. It will save you hours of typing. And breaking code down into variables makes it easier to understand when you come back to read it and makes it more usable as you start to write longer expressions.

117 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Greece
  • Has been a member for 1-2 years
  • Sold between 100 and 1 000 dollars
fAntasticmE says

felt do you have any programming background or just js for after effects?

by
by
by
by
by