This example is a loose guideline to steps to follow since your own will doubtless follow a slightly different path, just like Flocking.
- We’ll start with loading Lino Grandi’s menacing mecha fish. Use Load from Scene to bring in the fish from \Flocking\Mecha_Fish\Scenes\Fish_Animation.lws .
- In Layout, we’ll set our scene length to 600 frames and make a new Generator for a flock. Use a Box with a count of 4 x 4 x 4 and a size of 5 x 5 x 5. Open the Presets window and double click School . That will give us a flock of 64 agents that behave like fish. Once we’re happy with how they move we will vastly increase the numbers.
- 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 now have a school of 64 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.
- 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 cube 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.
- 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.
- 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 direct ors so much the better.
- 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.
- 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 new MDD Multi-Loader, explained in full on page 228.
- Now that you have an animation you are satisfied with, all that remains is for our 64 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.