Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions restricting the Angle Controller

  • restricting the Angle Controller

    Posted by Flook Flook on February 13, 2006 at 11:37 am

    Hi,

    I’ve posted this query elsewhere and it was suggested I try here because a venerable chap called DAN EBBERTS might be able to help.

    What I’ve been doing might sound like an unusual solution to a problem but it really suits what I’m working on: I’ve got a character walk-cycle of about 4 frames. The character is drawn from a slightly high 3/4 angle and needs to walk in a possible 8 directions. So I have 8 precomps of the walk cycle – 1 for each of the different directions (imagine an old 8-bit computer game like Commando – it’s that kind of deal).

    So I’ve got a composition with all of the walk cycles for each direction stacked up. My expression switches on the relevant layer and is controlled by an Angle Controller (which I keyframe). This is all working nicely.

    The problem is my angle controller goes beyond 360, clocking up revolutions and my expression isn’t sophisticated enough to account for this.

    Is there a way I can restrict my Angle Controller to 0-360? Somebody suggested a ‘modulus’ command which I looked into briefly but it didn’t seem quite what I was after.

    Does anyone have a solution?
    Much appreciated,

    Dave

    PS
    The Cowcast is awesome. I haven’t missed an episode. Keep up the good work Franklin & Ron!

    Flook Flook replied 20 years, 6 months ago 3 Members · 7 Replies
  • 7 Replies
  • Dan Ebberts

    February 13, 2006 at 2:53 pm

    Adding this expression to your angle control should do the trick:

    value%360

    The alternative would be to do the same thing in the expressions that reference the control, like this:

    effect(“Angle Control”)(“Angle”)%360

    ( “%” is the JavaScript modulus operator that returns the remainder of a division).

    Dan

  • Flook Flook

    February 13, 2006 at 2:59 pm

    You legend! Thanks so much. Your reputation is clearly very well deserved!

    Dave

  • Flook Flook

    February 13, 2006 at 3:04 pm

    Hey that did the trick so perfectly! Thanks again. How did you get so hot on expressions?
    Dave

  • Ron Lindeboom

    February 13, 2006 at 3:44 pm

    [Flook flook] “You legend! Thanks so much. Your reputation is clearly very well deserved!”

    Oh ye of little faith. You doubted?

    We are talking about Dan the Man here, afterall.

    ;o)

    Ron Lindeboom
    creativecow.net

  • Flook Flook

    February 13, 2006 at 4:34 pm

    It’s merely because it was my first post but you are right, I should not have doubted! I must add that I feel honoured to have a personal reply from Mr Lindeboom himself. Keep up the great work with the Podcasts (I never miss one) and the site. Amazing work! I look forward to using these great resource lots more.
    Thanks again,
    Dave

  • Ron Lindeboom

    February 13, 2006 at 4:45 pm

    Aw shucks, most Flookulous One, I am embarrassed that you “feel honoured to have a personal reply from Mr Lindeboom himself.” Trust me, it’s really no big deal and Kathlyn and I do not kid ourselves about who the real stars are around here. They are the members who interact and offer great advice, as well as the leaders whose faces you see up at the top of the forums. Our greatest skill is in keeping the lights on and building a backbone wherein this great community can function. But thank you for the kind words and for being a part of this great bovinian nation.

    The best always,

    Ron Lindeboom
    creativecow.net

  • Flook Flook

    February 13, 2006 at 5:50 pm

    Now you’re being too modest I’m sure! Really glad to have made your acquaintance & cheers for the great site & show. Looking forward to the next Podcast. Say hi to Franklin from a faithful listener. He sounds like a great guy too.

    Dave

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