Example - Mecha Fish

MechaFish animation (3.12 MB)


This example is a loose guideline to steps to follow since your own will doubtless follow a slightly different path, just like Flocking.

  1. We’ll start with loading Lino Grandi’s menacing mecha fish. Use Load from Scene to bring in the fish from the link above.


  2. In Layout, we’ll set our scene length to 600 frames and make a new Generator for a flock. Go to the FX Tools tab, open the Flocking window. Click Add New.. and choose Generator. Click the Presets button in the Flock Master window and choose the School preset. That will give us a flock of 125 agents that behave like fish. Once we’re happy with how they move we will vastly increase the numbers. Increase the size of the generator to 6 x 4 x 8 m.

  3. We need to apply our fish model to our flock, so call up Object Properties for the Generator and go to the Instancing tab. Add an Instance Generator and set it to Particles. Add object and choose your fish model. You won't see any of your Mecha Fish until you Calculate All Motions in the Flocking window.


  4. You now have a school of 125 fish with no goal, so we should add one. In the Flock Master window add a new Goal Director. Move the goal away from the fish so they have something to swim towards.

  5. We have made an instanced school of fish swim towards our goal, but the animation is fairly static and the fish stay in their initial box shape so we need to add more interest. On the path between our Generator and Goal add a new Deflect Director and set its range to something adequate for your scene (try a Range of 10 m and a Deflect Core of 5 m to start and if that seems overlarge, adjust). Calculate again and now your fish will split to go around the obstacle.

    If your fish aren't swimming fast enough to reach the goal in 600 frames, speed them up in the Agents tab by setting their Acceleration m/s2 and Max Speed m/s higher



  6. It’s still not amazingly interesting so add two or three more Deflect directors and place them offset to the side and above of the direct path, making sure that they at least overlap the path a little and influence the flock as it passes them to the goal. They will also need Ranges and Deflect Cores adjusted. Lastly, add some Avoids starting at their default Range of 1, but with Envelopes set to stepped to explode them into 10 m balls as the school of fish passes.


  7. Now, let’s move the Goal. Scrub through the timeline and watch for when your flock reaches the goal. At this frame, move the goal to a different location and keyframe it in place (if Autokey is active, this will happen automatically). Now calculate and watch the fish change direction. If the new position for the Goal takes the fish past the Avoid or Deflect directors so much the better.

  8. To get rid of our original model and only leave the instances in our scene, we need to visit the Scene Editor and make sure that the original model is marked as inactive by unchecking the left-most column entry for it. This will stop the original fish from being rendered.


  9. You have probably noticed that we have six entries in our Scene Editor for MechaFish. Our fish is animated through an MDD file and to prevent all our flock from making the same movement at the same time, we have cloned our initial fish several times. We then visited the I/O tab to use the MDD Multi-Loader.


  10. Now that you have an animation you are satisfied with, all that remains is for our 125 fish to become a real school. Try upping the quantity to 10 on each axis for 1,000 fish, but you’ll also want to increase the size of the box they "hatch" from because if it’s too small they will explode out of there trying to maintain their distance. Bear in mind also that you will probably want to increase the size of your Avoid and Deflect directors so they have more impact on a much larger quantity of fish.

In addition to moving your goals, try using the Envelopes for size and weight for the Avoid and Deflect directors to create sudden disturbances that make the fish create sudden turns or billowing in their movements.
If you need to use Calculate all Motions once you have applied your MDD-animated, subdivided fish, the chances are that calculations will be very slow. Turning SubD level down to 0 on the fish helps a lot, but better to remove the instances until you are ready to render your final animation.