Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects limiting rotations

  • limiting rotations

    Posted by Matt Howarth on August 24, 2017 at 3:14 pm

    hi all

    I’m attempting to make an automated pie chart, where you have as many segments as you like and the final segment fits into the remaining space perfectly. I have it working apart from the final segment. I am trying to use the rotation of the previous layer (combined with it’s own segment angle) to drive the final segment angle, but because of the way I have set up the previous segments, the penultimate angle can be several times 360 + the angle I want to use. For example:

    4x+240.0°

    in this instance how to I get rid of the 4x?

    I have tried writing a while loop to say while the angle is greater than 360, subtract 360, but it doesn’t seem to regard the 4x+240.0° as being more than 360.

    Any pointers would be gratefully received.

    cheers

    Matt

    Visual tinkerer and easily distracted admirer of all things shiny! – writer – animator – digital artist

    Matt Howarth replied 8 years, 8 months ago 3 Members · 3 Replies
  • 3 Replies
  • Chris Wright

    August 24, 2017 at 6:36 pm

    the good ‘ol trig expression pie chart i made a billion years ago
    https://forums.creativecow.net/thread/227/17128#17144

  • Walter Soyka

    August 25, 2017 at 3:04 pm

    [Matt Howarth] “I have tried writing a while loop to say while the angle is greater than 360, subtract 360, but it doesn’t seem to regard the 4x+240.0° as being more than 360.”

    Use the modulo operation [link], which returns the remainder after a division operation. 4x+240.0° (or 1680°) modulo 360 equals 240.

    Here’s sample code:

    x = thisComp.layer("LAYER NAME").transform.rotation % 360;

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Matt Howarth

    August 26, 2017 at 10:38 am

    thanks Walter,

    that was exactly what I was after : )

    cheers

    Matt

    Visual tinkerer and easily distracted admirer of all things shiny! – writer – animator – digital artist

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