Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Element 3D, rotation from AUTO ORIENTED Null

  • Element 3D, rotation from AUTO ORIENTED Null

    Posted by Stefan Hinze on November 29, 2012 at 10:51 am

    Hi,

    i try to get the Element 3D objekt to rotate like my Null-Onject.
    The Null has a path and is set to AutoOrientation.
    When it moves along the path, it orientates properly, but the parrentet Element 3D-Object dose´nt.

    How to make this work?
    Thanks!

    MacPro 10.6.8
    CS5

    Image A shows how it is, and image B how it should be…

    A

    B

    Stefan Hinze replied 13 years, 5 months ago 1 Member · 1 Reply
  • 1 Reply
  • Stefan Hinze

    November 29, 2012 at 11:52 am

    Ok, so i found something that works:
    (Thanks Dan! 😉 )

    i found this code here on the froum:
    (code below)

    Pasted is to a TEMP LAYER (Null), pickwiped the property to the right layer. After that i pickwiped the the XYZ-Rotation from Element3D zu the XYZ-Rotation of the TEMP-Null.

    “Pfiel – MOVER” is the Null with the animation and AutoOrientation on it.
    “Rotation – TEMP” is a null that only gets the Orientation copied from the Pfeil-Mover.
    “Pfeile” is the Element 3D Layer.

    Works fine, but i think i can get rid of the TEMP-Null..

    Thanks Dan

    L = this_comp.layer("Layer 1");
    s = L.scale/100;
    u = L.to_world_vec([s[0],0,0]);
    v = L.to_world_vec([0,s[1],0]);
    w = L.to_world_vec([0,0,s[2]]);
    sinb = clamp(w[0],-1,1);
    b = Math.asin(sinb/this_comp.pixel_aspect);
    cosb = Math.cos(b);
    if (Math.abs(cosb) > .0005){
    c = -Math.atan2(v[0],u[0]);
    a = -Math.atan2(w[1],w[2]);
    }else{
    a = Math.atan2(u[1],v[1]);
    c = 0;
    }
    [radians_to_degrees(a),radians_to_degrees(b),radians_to_degrees(c)]

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