Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Circle Expression

  • Posted by Mario Quintana on June 6, 2010 at 4:33 pm

    I am animating 2D a doughnut shaped wheel with a few pieces of text near the boundary of the wheel. I would like the text to remain level/legible while the wheel spins.

    I am animating the rotation of the wheel using a null object, and am trying to parent the text to the null as well, while keeping the text leveled.

    I am using the expression connected to this post for the position in my text layer, and another rotation expression tied to the rotation of the null to keep the rotation of the circle leveled.

    I understand the circle expression enough to control the size and the speed. However, when I apply the expression to the position control of the text layer, it repositions the text and I cannot figure out how it determines this starting position. The position is along the radius of the circle, just not where It was at the beginning of the expression. Because the layer is parented, I cannot just reposition. And because the expression is applied, I cannot modify the starting frame position.

    I would like to control the positioning of the text layer, the starting frame would be enough for my needs.

    Is there a way to control the starting frame?

    Or is there a line of code that would allow me to determine the starting position?

    Can anyone help me control the starting position, or help point me in the right direction? Please let me know if there are any questions. Thanks a million if anyone can help.

    ([this_comp.width/1, this_comp.height/1],
    [Math.sin(10)*100, -Math.cos(10)*100])

    Darby Edelen replied 16 years, 1 month ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    June 6, 2010 at 7:27 pm

    Use value to get the pre-expression value of a property. Just curious, why are you using an expression to position the text rather than just parenting?

    Dan

  • Mario Quintana

    June 6, 2010 at 7:42 pm

    Hey Dan,

    Thanks for the direction to try to simplify.

    I got it working, for now.

    I had originally tried simple parenting, but was not able to get the text to stay leveled.

    I just tried again, not using the position expression, and created an expression parenting the rotation of my text rotation to my null rotation, and by multiplying by -1.

    Don’t know why I thought this wasn’t working before, but it is now. Thanks.

  • Darby Edelen

    June 10, 2010 at 6:21 pm

    [Mario Quintana] “I had originally tried simple parenting, but was not able to get the text to stay leveled.”

    As you know, parenting interprets all of the child layer’s transform properties relative to the parent layer’s transformations. So your current solution of parenting and then removing the rotation works, but if all you need is the position to be locked, you should consider using an expression to tie only the position of the text to the wheel.

    Something like:

    l = thisComp.layer("TheWheel");
    l.toWorld(l.anchorPoint + position);

    Would allow you to offset the position of the text layer relative to the wheel using the text layer’s position property. So when you set the text layer’s position to [0,0] it’s anchor point will move to the anchor point of the wheel, then if you changed the text layer’s position to [0,100] it would move 100 pixels ‘down’ from the wheel’s anchor point (as the wheel rotates this ‘down’ direction will stick to the wheel… it’s ‘down’ the wheel, not ‘down’ the composition).

    This only ties the position of the text to the wheel, none of the other transform properties are animated. Even if you scale the wheel, the text will remain centered on the same location of the wheel, it just won’t get any larger/smaller 🙂 If you wanted it to, then you can simply pick whip the scale of the text layer to the scale of the wheel.

    Just another option 🙂

    Darby Edelen

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