Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Auto Orient Y-Only Issues

  • Auto Orient Y-Only Issues

    Posted by Luke Ogden on July 24, 2012 at 3:15 pm

    Auto Orient Carousel

    I know Its been asked before but im having issues and havent yet found a solution. I’ve made a carousel style animation (please see video) and used auto Orient to get the layers to always face the camera, which they do. I wanted to isolate it to just the Y axis so I came across Dan Ebbert’s expression here*:
    https://www.motionscript.com/design-guide/auto-orient-y-only.html

    which looked perfect but for some reason I haven’t been able to get it to work (see end portion of video). The aim is to have the two layers align with the focus plane of the camera as apposed to facing the camera itself.

    Any ideas what I might be doing wrong?

    The “product” images are made up of a front and back 3D layer (the BACK is parented to the FRONT) and have been given the ‘invisible when not facing the cam’ treatment ** and are parented to a rotating 3d null. Eventually these will flip to reveal the back of the product.

    any help would be greatly appreciated

    thanks

    * delta = toWorld(anchorPoint) - thisComp.activeCamera.toWorld([0,0,0]);
    radiansToDegrees(Math.atan2(delta[0],delta[2]))

    ** if (toCompVec([0, 0, 1])[2] > 0 ) value else 0

    Luke Ogden replied 13 years, 9 months ago 3 Members · 7 Replies
  • 7 Replies
  • Dan Ebberts

    July 24, 2012 at 3:33 pm

    Did you turn off auto orient?

    Dan

  • Luke Ogden

    July 24, 2012 at 4:23 pm

    I dont think so, I’ll check when I back at my computer.

    Is that the idea, that the expresion circumvents the use of auto orient?

  • Dan Ebberts

    July 24, 2012 at 4:33 pm

    Yes, it’s an alternative to auto orient.

    Dan

  • Luke Ogden

    July 24, 2012 at 5:02 pm

    I see, I’m back at my computer now and have turned of auto orient for both layers, but my issue now is they don’t face the camera as as the go round the carousel. As I change the y rotation of the null which drives the animation I can see the pink Y rotation of each of the parent ‘product’ layers moving but I cant see how its any different to having no expression, i.e. by the time they have rotated to the background I’m seeing the backside of them, whereas I want them to be perfectly parallel to the focus plane at all times. If that makes sense.

  • Dan Ebberts

    July 24, 2012 at 6:25 pm

    Good catch. The expression doesn’t completely account for the layer having a rotating parent. Assuming that you’re rotating the parent on the y axis, this should fix it:

    delta = toWorld(anchorPoint) – thisComp.activeCamera.toWorld([0,0,0]);
    r = radiansToDegrees(Math.atan2(delta[0],delta[2]));
    r -= hasParent ? parent.transform.yRotation : 0

    Dan

  • Darby Edelen

    July 25, 2012 at 5:46 am

    If you wanted to create even more complicated parent/child relationships I believe all you’d need to do is transform the vector into from world space to the layer’s space:

    delta = toWorld(anchorPoint) - thisComp.activeCamera.toWorld([0,0,0]);
    vec = fromWorldVec(delta);
    r = radiansToDegrees(Math.atan2(vec[0],vec[2]));

    Interesting side effect of the space transform is that you can also change the keyframed Y-rotation to offset the orientation.

    Darby Edelen

  • Luke Ogden

    July 25, 2012 at 11:52 am

    This seems to have solved it.
    Thanks Gents

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