Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects How do I get the real coordinates of a 3D layer oriented along a path?

  • How do I get the real coordinates of a 3D layer oriented along a path?

    Posted by James Braithwaite on July 26, 2017 at 12:56 pm

    I’m using Element3D, (a 3D plugin for After Effects) and I have a model that uses the position and rotation of a 3D null object to move around in 3D space. It also means I can parent other 3D layers to this null object, and generally makes the whole affair a lot easier.

    Anyway, I want to have this null object orient along a path, but because it doesn’t output rotation values the 3D object doesn’t rotate along with it. Now, I have found an expression to fix this and it works pretty much perfectly:

    L = this_comp.layer(“LAYER”);
    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)]

    However, it is extremely long and complicated. I never learned expressions, and I don’t have the foggiest idea of what most of it means. My current project requires, or would prefer, a simpler expression if that is at all possible.

    If nothing else, from now on I think I’ll endeavour to learn expressions beyond wiggle, time and loopOut, rather than just using Google.

    James Braithwaite replied 9 years, 1 month ago 2 Members · 2 Replies
  • 2 Replies
  • Steve Bentley

    July 31, 2017 at 3:10 pm

    Can you reoutput your 3D nulls from your 3D package? If so, don’t use nulls. Stick a camera inside your object that would normally become your null and have it fly around with the object. When the camera comes in it will have rotation information

  • James Braithwaite

    August 3, 2017 at 2:23 pm

    Assuming I’ve understood correctly, it doesn’t seem that the camera outputs rotational data when oriented along a path.

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