Activity › Forums › Adobe After Effects Expressions › One last ‘Follow the Leader’ frame delay expresssion issue
-
One last ‘Follow the Leader’ frame delay expresssion issue
Posted by Richard Powell on September 19, 2006 at 7:23 pmYesterday Dan Ebberts and Mylenium teamed up to provide this nice expression below. The expression relies on layer 1 in a comp as leader, so there’s only one leader per comp apparently. Essentially, I want layer 1 to lead layers 1-13 and layer 14 to lead layers 15-26. What part of this has to change to make that work?
d = delay*thisComp.frameDuration*(index – 1);
p = thisComp.layer(1).position.valueAtTime(time – d);
[p[0],value[1]]Roland R. kahlenberg replied 19 years, 10 months ago 3 Members · 9 Replies -
9 Replies
-
Roland R. kahlenberg
September 19, 2006 at 7:52 pmHeh Dude! Haven’t seen you here for a while. I can’t dissect the Expression in under 10 minutes and it’s sleep time but it looks like you can precomp the two groups since layer 1 and 14 are independent of each other.
Or you could simply remove the expression for layer 14 and keyframe that. And use the expression for layers 15-26 – if I’m understanding your purpose for all of this correctly.
HTH
Roland Kahlenberg
broadcastGEMs
customizable animated backdrops with Adobe After Effects project files -
Richard Powell
September 19, 2006 at 8:03 pmYo Roland! Long time bro.
Yeah, I tried both of those. Keyframing layer 14 leaves layer 15 still following layer 1. Splitting the two halves into separate comps would be fine if it wasn’t for having to work with that setup 90 times. Ick, this is an awful project.
Cheers,
gov -
Roland R. kahlenberg
September 19, 2006 at 8:56 pmDude! In line 2 of the script, “p= …”, simply replace the number “1” after the word layer with “14” for layers 15-upto whatever number you want. Essentially, any layer with this scipt will follow layer 14.
//original script – layer 1 as leader
d = delay*thisComp.frameDuration*(index – 1);
p = thisComp.layer(1).position.valueAtTime(time – d);
[p[0],value[1]]
////amended script – layer 14 as leader
d = delay*thisComp.frameDuration*(index – 1);
p = thisComp.layer(1).position.valueAtTime(time – d);
[p[0],value[1]]
//Cheers
Roland Kahlenberg
broadcastGEMs
customizable animated backdrops with Adobe After Effects project files -
Roland R. kahlenberg
September 19, 2006 at 9:17 pmBro, you may want to look at using a particle generator. PP can do strict horizontal movements quite well. With lots of particles, you may get the look that you want. And the thing with working with layer indices is that it slows down as you add more layers to a group. Althought with groups of 14, it should be ok.
Just a thought.
Cheers
Roland Kahlenberg
broadcastGEMs
customizable animated backdrops with Adobe After Effects project files -
Dan Ebberts
September 19, 2006 at 9:30 pmGive this a try, it should be close:
groupSize = 13;
leaderIndex = Math.floor((index – 1)/groupSize)*groupSize + 1;
d = delay*thisComp.frameDuration*(index – leaderIndex);
p = thisComp.layer(leaderIndex).position.valueAtTime(time – d);
[p[0],value[1]]Dan
-
Richard Powell
September 19, 2006 at 10:18 pmHaha, great minds…I tried that, but is that [1] a reference to the x or y axis, or to a layer? Anyway it was a no-go. Lessee what Dan’s solution does…
-
Richard Powell
September 19, 2006 at 10:51 pmAlmost. Guess what, I made it work by FIXING a Dan Ebberts expression! Hee hee, I have something to tell my grandkids. It’s like fixing the seasoning on a plate by Mario Batali.
It didn’t work without that top line from the old expression. (Dan probably assumed I knew that.)
delay = 1; //number of frames to delay
groupSize = 13;
leaderIndex = Math.floor((index – 1)/groupSize)*groupSize + 1;
d = delay*thisComp.frameDuration*(index – leaderIndex);
p = thisComp.layer(leaderIndex).position.valueAtTime(time – d);
[p[0],value[1]] -
Dan Ebberts
September 20, 2006 at 12:00 amActually, I couldn’t remember where delay came from (I thought it might be a slider on a null or something). I just knew it wasn’t included in the expression you originallly posted so I took it out assuming you would match the new piece up with whatever defined delay. Maybe I could have mentioned that.
🙂
Dan
Reply to this Discussion! Login or Sign Up