Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Changing Rotation In Offset

  • Changing Rotation In Offset

    Posted by Liran Lin on May 25, 2020 at 10:27 am

    Hi,
    I have a COMP with layers that i Can Control there Z Deph and X and Y Position, But i Cant Change there Rotation with a CONTROLLER and with a little Offset in Between them.

    I’m Trying to do 2 things.

    1. To change to rotation of multi layers with a Little offset in between them, and connecting to a rotation controller so i Could the Value of the offset.
    2. I would like to make a Delay in the Position and Rotation in the layers Which will follow the Main Layer After Im making a Keyframe animation for the main layer.

    I Hope i Explained myself OK.

    Thanks in advance
    Liran

    //Position controller
    z = (index-1)*thisComp.layer("CONTROL").effect("Z")("Slider");
    x = (index-1)*thisComp.layer("CONTROL").effect("X")("Slider");
    y = (index-1)*thisComp.layer("CONTROL").effect("Y")("Slider");

    [value[0]+x,value[1]+y,value[2]+z];

    Robert Müller replied 5 years, 11 months ago 2 Members · 1 Reply
  • 1 Reply
  • Robert Müller

    May 26, 2020 at 9:37 am

    Hi,
    First for the delay, you should reference the position of your original layer like this:
    //Position controller
    z = (index-1)*thisComp.layer("CONTROL").effect("Z")("Slider");
    x = (index-1)*thisComp.layer("CONTROL").effect("X")("Slider");
    y = (index-1)*thisComp.layer("CONTROL").effect("Y")("Slider");

    delay=0.5; //delay in seconds
    mainPos=thisComp.layer("Main_layer").transform.position.valueAtTime(time-delay);

    [mainPos[0]+x,mainPos[1]+y,mainPos[2]+z];

    And for the rotation its pretty similar with angle controlls instead of sliders (nore: I used the orientation property so that I only have one expression for all the angles)
    //Rotation controller
    rotX = (index-1)*thisComp.layer("CONTROL").effect("rot.X")(1);
    rotY = (index-1)*thisComp.layer("CONTROL").effect("rot.Y")(1);
    rotZ = (index-1)*thisComp.layer("CONTROL").effect("rot.Z")(1);

    delay=0.5; //delay in seconds
    mainRot=thisComp.layer("Main_layer").transform.orientation.valueAtTime(time-delay);

    [mainRot[0]+rotX,mainRot[1]+rotY,mainRot[2]+rotZ];

    Note that if you have a controll layer and a Main layer, you might have to change the index calculation, depending on how your layers are arranged.

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