Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions finding the exact position of parented camera

  • finding the exact position of parented camera

    Posted by Shahed Naderi on November 4, 2015 at 4:51 am

    I have a camera which is parented to a null.I want to calculate the length between my camera and another null for camera distant so I can get a proper focus, but the problem is parented cameras have a different positions values which they’re not correct , I need it’s absolute value.

    toWorld(transform.position) dont give me that.

    thanks for advise

    Shahed Naderi replied 10 years, 5 months ago 2 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    November 4, 2015 at 5:43 am

    To get the world position of a camera, use:

    myCamera.toWorld([0,0,0])

    Dan

  • Shahed Naderi

    November 6, 2015 at 10:10 pm

    thanks for the code, but I also need to link back the point of interest to another null , but since the camera is parented, the new values are not useful , … I just find the answer right now! I can parent it to the null which my camera is parented to and then get the values! , but how about to translate the point of interest of my camera to world values ?
    is it a different form of using the code ?

  • Dan Ebberts

    November 6, 2015 at 10:51 pm

    Like this maybe:

    L = thisComp.layer(“Null 2”);
    fromWorld(L.toWorld(L.anchorPoint));

    Dan

  • Shahed Naderi

    March 28, 2016 at 3:07 pm

    hello again

    I have this issue with other layers too, since you parent any layer including lights, solids and others to another one it changes the position , but I need the unchanged value , for example when I want to use “length” expression in order to get a proper value for my camera focus I need two points to be in the same axis system , [0,0,0].

    but it seems layer.toWorld([0,0,0]) expression doesnt return that value !

  • Dan Ebberts

    March 28, 2016 at 5:20 pm

    I’m not sure I understand. Can you post your whole expression?

  • Shahed Naderi

    March 28, 2016 at 6:06 pm

    sorry , I asked it before and I got my answer, just had the same problem after 5 mounts , and I didnt see the whole tread , it’s just a bit different with solids because of anchor point.

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