Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects expressions help!

  • expressions help!

    Posted by Cory06 on January 24, 2006 at 6:22 pm

    i am trying to come up with an expression that will allow me to isolate the z property of an object. i need to have objects follow a middle object in incremented steps. i.e. i have a row of pop cans. when i move the center can forward in Z, the cans on either side will follow once the middle can has moved forward by 10. once the second row has moved forward to that same mark in Z, the second set of surrounding cans will then begin to move forward with them. so on and so forth…….

    if anybody can help i would greatly appreciate it!!

    thank you in advance

    cory

    Cory06 replied 20 years, 7 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    January 24, 2006 at 7:28 pm

    Once the middle can gets ahead of the second can by 10, does the second can retain its relative distance of 10 from the middle can?

    Dan

  • Cory06

    January 24, 2006 at 8:11 pm

    yes it would.

    thank you for your help

  • Dan Ebberts

    January 24, 2006 at 8:25 pm

    Try this:

    gap = 10;
    myIdx = Math.floor(index/2);
    myGap = myIdx*gap;
    leaderZ = thisComp.layer(1).position[2];
    delta = position[2] – leaderZ;
    if (delta > myGap){
    [value[0],value[1],leaderZ + myGap]
    }else{
    value;
    }

    It assumes that the center layer is Layer 1, the layers on each side of that are Layer 2 and Layer 3 and so on.

    Dan

  • Cory06

    January 24, 2006 at 10:58 pm

    thank you very much!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy