4 Replies Latest reply on Mar 14, 2008 10:59 AM by A. Cobb

    How to stabilize with 1 null containing pos, rot, scale?

    David Wigforss-Hv1BNN Level 2
      I've manually tracked my characters face, via a null positioned at the bottom of his nose line, and the bottom of his inner ear line. Attaching my mouth shapes to that track works great and demonstrates that it's a good track.

      Now, I want to redo the eye animation. So, I want to stabilize the animation based on my face tracker. However, I need a two point stabilize track, and I've only got 1 null.. I duplicated the null, stripped its animated properties, repositioned it to the tip of the track null, and parented it to the track null.

      I tried setting up an expression on attach point 2, but it's not working correctly.


      I've also tried toComp, fromComp and fromWorld - none of them change the value of the parented null's position.

      Thanks for your help.
        • 1. Re: How to stabilize with 1 null containing pos, rot, scale?
          Jonas Hummelstrand Level 2
          Is the Null a 3D layer? I believe the to-functions you've tried convert 3D positions into 2D positions.

          If you want to lock for example the movement to just the Y position of another layer, you can use the expression-pickwhip and drag it to the layer's Y position readout to automatically link to just that property.

          Did that help?

          - Jonas Hummelstrand
          • 2. Re: How to stabilize with 1 null containing pos, rot, scale?
            David Wigforss-Hv1BNN Level 2
            Nope... My nulls are 2d. No 3d... My problem is: how to read out the world coordinates of a layer that is parented... Right now, all the transforms of the child are zeroed, so the child's positional values are different than it's world value. (ie [0,0] as opposed to [200,310]

            I need more than just linking the y positions... I also have rotational and scale values, and dunno how to calculate for that - I'm a bit flakey on my cos & sin math.....

            I've already finished this current project, I'm just wondering for a solution for next time. Rather than stabilizing the original footage and time remapping the animated eyes, I created my own via shape layers.

            Frequently, I use this 1 null method when tracking a character's face and I'm replacing eyes and lipsync - manually track it with 1 null using pos, rot, and scale. Move the null into 1 stationary position (tip of nose is usually good). Then, find another stationary bit (tip of inside ear is usually good for me as well), and rotate and scale the null, so that it reaches that other point. Then you just need to manually adjust the values as the animation progresses. After that, just parent the new mouths and eyes to track and you're done. It's quick and simple.. But it has it's drawbacks, such as this situation, where I'd like to stabilize the original animation based on only 1 null containing pos, rot, and scale (2d). I've had hit and miss success when using AE tracker for facial features...

            • 3. Re: How to stabilize with 1 null containing pos, rot, scale?
              Mylenium Most Valuable Participant
              I'm still having a hard time picturing what you are trying to do, but you should be able to get everything you need by combining toComp() and fromComp(). Since the tracker data is relative to the layer, it would have to be converted to comp coordinates first before re-applying it to the second tracker as a relative offset.

              • 4. Re: How to stabilize with 1 null containing pos, rot, scale?
                A. Cobb Level 3
                If you want to get the comp coordinates of a layer's position, the simplest way is, somewhat unintuitively, to get the comp coordinates of the layer's anchor point using:


                The reason toComp(position) doesn't work is because the position isn't described in the layer's coordinate space, but rather in the layer's parent's space if it has a parent, or in world space if it does not. The anchor point is described in the layer's local coordinate space, and is always at the same point as the position when the two are transformed to the same coordinate space.

                You could use:


                which calls the toComp member function of the parent layer, but this code will break if there is no parent, so to make the code robust you would have to test for hasParent (or something like that). Transforming the anchor point is a bit less work.