Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions toComp problem with parented camera.

  • toComp problem with parented camera.

    Posted by Anders Hattne on February 13, 2010 at 6:50 pm

    Hello!

    I’ve used the expression toComp to make a beam connect between two 3d objects and that works fine.

    The problem is I’ve built a camera rig with 4 nulls (bank, pitch..) and when I then rotate around the Y axis with my camera controllers, the toComp expression seems to be ignored. If I rotate only the camera the beam connection works.

    Grateful for help!

    ps.
    I looked at the tracking a Child parent tutorial by Carl Larsen and suppose the problem lies along those lines. There I used the toWorld expression.. but have no idea how to apply that here..

    http://www.ardillamedia.com

    Ben Rollason replied 16 years, 1 month ago 3 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    February 14, 2010 at 12:21 am

    The Beam effect should be applied to a 2D layer. If you’ve done that, toComp() should work no matter how the camera is positioned/oriented.

    Dan

  • Anders Hattne

    February 14, 2010 at 1:33 pm

    Hi Dan, thanks for your reply.
    Yes the beam is applied to a 2d Layer, and that works fine.

    The rig for the camera, which I got of Maltaannon.com is 4 nulls, parented to each other. So I use the one axis of per null to control rotation. Last null has controllers.
    When I then use the controllers my objects move around but the beam stays put!

    For now I got rid of the rig, and just made a simple track backwards, but for complex moves I’d need a rig so I’d like to know why that doesn’t work.

    thisComp.layer("sphere_Business1").toComp([400, 400, 200])

    http://www.ardillamedia.com

  • Dan Ebberts

    February 15, 2010 at 5:00 am

    It’s really hard to say without seeing exactly how you have it set up.

    Dan

  • Ben Rollason

    April 7, 2010 at 4:14 pm

    You probably need to be inputing the positional data in world space

    instead of

    tC = thisComp.activeCamera;
    tL = thisComp.layer("a child layer"); //this layer is parented to something.
    tC.toComp(tL.position);
    

    maybe something like this.

    tC = thisComp.activeCamera;
    tL = thisComp.layer("a child layer"); //this layer is parented to something.
    tC.toComp(tC.fromWorld(tL.toWorld(tL.anchorPoint)));
    

    I think that’s more universal as it makes sure your original point is in worldspace, then brings that into the camera’s layer space and from there into the camera’s 2D comp space.

    -Ben.

    http://www.benrollason.com

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