Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Animating A School of Fish

  • Animating A School of Fish

    Posted by Cutter Johnston on October 28, 2008 at 3:36 pm

    Using a direct expression to a Null controlling multiple layers, is there a way to adjust the expression per-layer to vary the position, rotation, etc. individually? It seems like adding *(.05,.08,.04) to the property does somewhat work but not completely. Any clues or pointing in the right direction would be greatly appreciated.

    Cutter Johnston replied 17 years, 6 months ago 3 Members · 5 Replies
  • 5 Replies
  • Eric Sanderson

    October 28, 2008 at 8:49 pm

    So what exactly are you working with here? Multiple layers youve script pick-whipped to a null? If so have you tried just parenting the objects to the null and just putting a wiggle on the position and rotation of the objects?

  • Kevin Camp

    October 28, 2008 at 9:23 pm

    following what eric suggested, and not knowing exactly what you have already, you might try using the null and fish layers in a ‘follow the leader’ like method…

    apply 2 slider effects (expression controls>slider control) to the null. enter a value of say 1 for the first slider and 10 fo the second.

    apply this expression to a fish layer’s position (this was taken from motionscript .com:
    leader = thisComp.layer(‘Null 1’); // this needs to be your null layer
    freq = leader.effect(‘Slider Control’)(‘Slider’);
    amount = leader.effect(‘Slider Control 2’)(‘Slider’);
    leader + wiggle(freq,amount) – position

    now, select the position porperty that has this expression, choose edit>copy expression only. then select all your fish and choose edit>paste.

    now all you fish should ‘swim’ or ‘swarm’ around your null layer as it move around. you will most likely need to change the slider values to get closer to the effect you are looking for, but those sliders will control the whole school of fish.

    for rotation, unless you want them to follow the null’s rotation, you could try a simple wiggle expression for the fish’s rotation. if you wanted to loosely follow the null’s rotation, you could use a similar expression as above…

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Kevin Camp

    October 28, 2008 at 9:34 pm

    the last line should read like this:
    leader.position + wiggle(freq,amount) – position

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Kevin Camp

    October 28, 2008 at 9:57 pm

    i played around with this a bit and found that making all layers 3d (including the null) and setting the fish to auto orient along path (select the fish, choose layer>transform>auto orient, choose along path), then set orientation (rotation) for the fish to 270,90,0 (well, my fish was vertical, your orientation may be a bit different) made a fairly good school of fish…

    my slider values were, 1 and 100 and my null’s position was a wiggle expression:
    wiggle(.4,200)

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Cutter Johnston

    October 31, 2008 at 1:35 pm

    THANK YOU!!! for the script and replies. I will hammer this home today and post the URL soon after. I really appreciate the assistance.

    Cutter

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