Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Turn rotation expression on and off

  • Turn rotation expression on and off

    Posted by Nate Vander plas on May 2, 2016 at 6:01 pm

    I’m creating a “simple” ball character rig, and I want to use the expression that’s used by DUIK’s Wheel animation tool. It looks like this:

    O = thisLayer.toWorld(thisLayer.anchorPoint);
    R = thisLayer.effect('Radius')(1);
    Rev = thisLayer.effect('Reverse')(1);
    result = 0;
    R > 0 ? result = radiansToDegrees(O[0]/R) : result = 0 ;Rev == 1 ? value - result : value + result;

    There are two controllers that automatically get added onto the null- one slider for Radius and one checkbox for Reverse. I want to be able to animate this feature on and off depending on how I’m animating the character, but can’t seem to find a good solution. If I change the above expression to multiply “result” by 0, it stops having an effect, but if I animate that with a slider it has to spin back to where it started. Is there an expression that can freeze this expression where it is? Maybe it can be done with markers? I’d like to be able to ease it on and off rather than having just a checkbox, but I at least need the function of a checkbox.

    Nate Vander plas replied 10 years ago 2 Members · 2 Replies
  • 2 Replies
  • Kalleheikki Kannisto

    May 3, 2016 at 10:01 am

    To do that you would need to check backwards through each checkbox keyframe and add up the (change in) rotation values, based on position values, from those sections where the checkbox was on, and then calculate the difference between the last checkbox (if it is an “on” checkbox”) and the current position.

    It is doable, but much more complicated than that original expression.

    And if you want to add ease in and ease out, it gets even more complex.

    In any case, it would minimally require a for-loop for the checkbox keyframes, and a cumulative sum of the value change during each “on” section.

  • Nate Vander plas

    May 3, 2016 at 1:22 pm

    Thanks for the help, Kalle. Now I at least know this is not a plausible route. I think my solution will be to get this script that allows you to animate parenting on and off: https://aescripts.com/good-parents/

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