Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions making a fan…

  • Posted by Craig Hellen on July 2, 2009 at 7:32 pm

    Hey guys, in this heat (over here in england, we dont take to it so well!) I was using one of those Japanese fans and thought that it would be a cool thing to animate in AE.

    you know the type; https://www.saiga-jp.com/img/item_l/F-201_japanese_fan.jpg

    Im a bit of a novice at expressions but the basic logic behind it is:
    solid a rotates about a common anchor to a certain angle,
    when this angle is reached this starts the next piece moving to the previous angle increment + 1
    And repeat this for the rest of the segments,

    Just thought it might make a cool way to learn a bit of this expressions lark.

    Hope this kinda makes sense!

    Craig

    Co-Director Podchains Ltd
    Video Producer / Motion graphics designer https://bexmedia.net

    Paul Hennell replied 16 years, 10 months ago 2 Members · 1 Reply
  • 1 Reply
  • Paul Hennell

    July 6, 2009 at 3:30 am

    heh – In today’s more typical rainy English weather I took your idea and rather ran with it – ended up with this:

    …Anyway was intending to explain the whole ‘fan’ thing..

    Take your fan layer, and move it’s anchor point to where you want it to be. Add a null object above it called ‘FanControl’ and add to that an angle expression control called ‘Spread’.

    Position the null in roughly the same place as the fan layers anchor point and parent the fan layer to the null. this just makes the fan easier to move about later.

    Now Alt-click on the fan layer and add the following expression under rotation:


    pos = index-1;
    angle = -5;
    if (thisComp.layer("FanControl").effect("Spread")("Angle") >pos*angle){
    pos*angle;
    }else{
    thisComp.layer("FanControl").effect("Spread")("Angle")
    }

    This (in order) does the following;
    Sets ‘pos’ as index – 1. Index is AE’s reference to the layer number – we’re subtracting 1 because our null is layer number 1.
    Sets ‘angle’ as -5. This is the difference between each layers rotation value. -5 worked for me, but put what ever you like. (It’s ‘-‘ because that made it rotate in the right direction 😉 )

    The next part checks the value of the ‘FanControl’ layers ‘Spread Angle’. If it is greater than it’s position number * the difference angle, it will set it’s rotation to whatever it’s pos*angle is. Otherwise it will set it’s rotation to whatever the Spread Angle is. Essentially we’ve set a maximum rotation value for each layer with a 5 degree difference between them. Each layer will follow Spread Angle until it gets larger than their maximum value, at which point they’ll stay put.

    To get this all to work, duplicate the FanLayer a number of times, and change the spread angle. You might need to rotate the null, to get the fan on screen properly, but it looks pretty good.

    Hopefully that all makes sense; it’s a good use of expressions (except it could probably be made ‘cleaner’) – if you’re interested in learning more expression stuff I can really recommend this book which manages to explain it all surprisingly well.


    Only in after effects do children get to pick and whip their parents.
    https://hennell-online.co.uk

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