Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: HomeForumBasicsExpressionsTutorialsPodcastsMotion GraphicsTrainingCinema 4DFAQ

To expression and gurus- Stretch a chain?

Cow Forums : Adobe After Effects Expressions

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>
To expression and gurus- Stretch a chain?
by drew fields on Aug 25, 2008 at 6:32:16 pm

So, i've been beating my head against a lot of expression control forums and tutorials in the hopes of finding something to help me achieve this goal-

i have 16 "links" in a beaded chain and i want to simulate a stretch effect. my hopes were to learn/find an expression where the FIRST bead stays anchored at one point while the position the LAST bead in the chain effects the placement of all the bead in between the two. the beads would grow more equidistant from each other as the FIRST and LAST beads become further and further apart to simulate stretching. make sense?

any ideas... anywhere?

muchos thankos,
drew

Respond to this post   •   Return to posts index

Re: To expression and gurus- Stretch a chain?
by Dan Ebberts on Aug 25, 2008 at 7:12:22 pm

Assuming you want the beads in a straight line and the beads are layers 1 thru 16:

numBeads = 16;
if (thisComp.numLayers >= numBeads){
P1 = thisComp.layer(numBeads).transform.position;
P0 = thisComp.layer(1).transform.position;
delta = P1 - P0;
P0 + ((delta/(numBeads - 1))*(index - 1))
}else{
value
}


Dan



Respond to this post   •   Return to posts index

Re: To expression and gurus- Stretch a chain?
by drew fields on Aug 25, 2008 at 9:20:25 pm

so, where am i placing this code? the position of all the beads?



Respond to this post   •   Return to posts index


Re: To expression and gurus- Stretch a chain?
by Dan Ebberts on Aug 25, 2008 at 10:04:04 pm

Yes. The first and last ones don't need it, but it doesn't hurt to put it on all of them.

Dan



Respond to this post   •   Return to posts index

Re: To expression and gurus- Stretch a chain?
by Dan Ebberts on Aug 25, 2008 at 10:14:17 pm

Actually, this is better:

numBeads = 16;
if (thisComp.numLayers >= numBeads){
P1 = thisComp.layer(numBeads).transform.position;
P0 = thisComp.layer(1).transform.position;
linear (index,1,16,P0,P1)
}else{
value
}



Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]