Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Dividing Z Value by INDEX. Expression advice

  • Dividing Z Value by INDEX. Expression advice

    Posted by Victor Mayorga on May 14, 2014 at 9:28 pm

    I have 5 circles, with the center being the Main Circle. When I move the Main circle in the Z depth I want the other circles to be
    divided by the Index
    OR
    Subtract by (Value * Index)

    Dont know if I should go with the divide or Subtract until I see it in action.

    I want to get a speaker playing effect.

    I dont know how to just Subtract/divide ONLY the Z Value, I can get to work on all 3 values (x,y,z) but not just Z.

    George Goodman replied 12 years, 4 months ago 2 Members · 1 Reply
  • 1 Reply
  • George Goodman

    May 15, 2014 at 1:24 pm

    This would be division:

    zlead=thisComp.layer(“leaderlayer”).transform.position[2];
    zpos= zlead/index;
    [value[0],value[1],zpos]

    But I recommend doing it differently because the values aren’t going to be consistent, for example, when you switch from positive to negative numbers. Instead, I recommend using a multiplier for the index and add (subtract because positive numbers are further back in z space) that. Something like this:

    zlead=thisComp.layer(“leaderlayer”).transform.position[2];
    mult=100;
    zpos= zlead+index*mult;
    [value[0],value[1],zpos]

    Now in this case, the second layer will always be 100 behind the leader layer. If you apply the expression to the third layer in the timeline, it will always be 300 behind the leader layer. If you want to make it further, just change the number in the multiplier to be higher. Also, make sure to change the name of the ‘leaderlayer’ to whatever that layer is actually called.

    “|_ (°_0) _|”

    Sincerely,

    George

    http://www.vimeo.com/georgegoodman
    http://www.linkedin.com/in/georgefranklingoodman

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