Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: HomeForumBasicsExpressionsTutorialsPodcastsMotion GraphicsTrainingCinema 4DFAQ

Re: making a fan...

Cow Forums : Adobe After Effects Expressions
VIEW POSTS   •   ADD A NEW POST   •   SEARCH   •   CHANGE FORUM
Respond to this post   •   Return to posts index   •   Read entire thread


Re: making a fan...
by Paul Hennell on Jul 6, 2009 at 3:30:13 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.
http://hennell-online.co.uk


Respond to this post   •   Return to posts index   •   Read entire thread


Current Message Thread:
  • making a fan... by craig hellen on Jul 2, 2009 at 7:32:22 pm
    • Re: making a fan... by Paul Hennell on Jul 6, 2009 at 3:30:13 am


Related Threads:
Making an AE puppet with multiple layers   |   Expression for Making a Layer Travel in a Triangle   |   Expression for Making Something Travel in an Oval?   |   making copy of a parent follow the parent's position but in opposite x axis   |   Making multiple versions of a render   |   Making audio react to opacity   |   making different images appear using audio amplitude...   |   Making Light Disappear & Reappear Behind Objects Using Expressions   |   Making a compound 3D object w/ Shatter   |   Making objects change position while within range of a camera



Note: If you are a registered user please click here to login before posting.

Your post will not be accepted if your name and email address are not registered in our database. Click here if you do not have an account.

Name
E-Mail Address
Subject
E-Mail me when someone responds
Just This Message   Entire Thread   None  

Message:



Note: The following are HTML characters and may cause parts of your post to disappear if not used correctly: < > &
To include any portion of the post in your response, highlight the desired text and hit the "Q" key. Read more...



Please post Expressions Code in the box below:


Add your message signature


 


Note: By clicking "Post Direct" button above, you are agreeing to the Creative Cow's Code of Conduct.



FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]