ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Controlling layers with identical animation but scattered over timeline

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Eddie Bogdanov
Controlling layers with identical animation but scattered over timeline
on Jun 19, 2012 at 4:24:42 pm

Hello.

I'm in a situation where I have around 700 layers and all of them have identical animation - a small position and opacity change. The problem is that they are on different places on timeline and it's a pain if I want to change the keyframe values/length.
Maybe there is some smart way to make the control of the animation easier, with sliders perhaps?

The easiest way for me at the moment is rearranging all of them to 0:00 second mark / deleting keyframes and creating new ones, then scatter them using a script but it takes a while and is pretty heavy on resources.

Thanks


Return to posts index

Dan Ebberts
Re: Controlling layers with identical animation but scattered over timeline
on Jun 19, 2012 at 4:49:51 pm

You could use sliders, but then you need to be able to define the animation in terms of a formula (sometimes easy, sometimes not).

Or, you could designate a keyframed layer as the leader and have the others reference that one. That way you'd only have to update one. A position expression to track the leader's changes since its in point would look like this:

t = time-inPoint;
L = thisComp.layer("leader");
v0 = L.transform.position.valueAtTime(L.inPoint);
v1 = L.transform.position.valueAtTime(L.inPoint+t);
value + v1 - v0


Dan



Return to posts index

Eddie Bogdanov
Re: Controlling layers with identical animation but scattered over timeline
on Jun 19, 2012 at 6:36:49 pm

Wow, it worked perfectly. You are saving me so much time... thanks man!

What changes do I make so it would work for opacity too?


Return to posts index


Dan Ebberts
Re: Controlling layers with identical animation but scattered over timeline
on Jun 19, 2012 at 6:41:44 pm

Wherever you see "position", change it to "opacity". :-)

dan



Return to posts index

Eddie Bogdanov
Re: Controlling layers with identical animation but scattered over timeline
on Jun 19, 2012 at 6:59:40 pm

Yes, I tried that at first and it didn't work. Played around and figured that before applying the expression, opacity must be the same value as the first keyframe of "leader"... in my case - 0%.

Thanks again! You are a great man :)


Return to posts index

JuanLuis Vich
Re: Controlling layers with identical animation but scattered over timeline
on Jan 28, 2017 at 1:31:43 am

that's a great piece of code!
I'm wondering, how could it be adapted to make a marker the trigger instead of the inPoint? So I can have a layer with a solid standing there and when the timeline reaches the marker the animation starts.

thanks!


Return to posts index


Dan Ebberts
Re: Controlling layers with identical animation but scattered over timeline
on Jan 28, 2017 at 1:57:40 am

This would be one way:


if (marker.numKeys > 0){
t = Math.max(time - marker.key(1).time,0);
}else{
t = 0;
}
L = thisComp.layer("leader");
v0 = L.transform.position.valueAtTime(L.inPoint);
v1 = L.transform.position.valueAtTime(L.inPoint+t);
value + v1 - v0



Dan



Return to posts index

JuanLuis Vich
Re: Controlling layers with identical animation but scattered over timeline
on Jan 28, 2017 at 2:14:37 am

awesome! thanks!!


Return to posts index

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