In this Tips and Tricks episode we answer several questions frequently asked by users about animating with Forest Pack, and explain in detail how to control animation applied to scattered objects. Forest Pack has four unique modes that enable you not only to scatter animated objects with significant memory efficiency, but also randomise their starting frames, create offsets and control playback using maps. We'll start by looking at the principles of these modes in detail and then apply the techniques to the simple scene shown above.
By completing this tutorial you will be able to:
This tutorial requires Forest Pack Pro and RailClone Lite or Pro, the lite version can be downloaded free from here. Parts of this tutorial also use Bercon Maps, and GrowFX though they aren't essential for completing the scene.
The scene files included in the downloads for this tutorial use animated meshes created with the GrowFX plugin by Exlevel. GrowFX greatly simplifies the process of creating parametric plants, trees, flowers and other nature models and also has robust tools for animating wind and growth animations.
If you do not own GrowFX, don't worry! We've included simplified plant animations using Max's native tools. These can be found in a layer called Standard Plants. If you'd like to try GrowFX, a 30 day trial can be downloaded from our store.
The exercise files for this tutorial includes the following .max scenes compatible with Forest Pack Pro, RailClone lite, Max 2010, and V-Ray or Mental Ray.
By default the plugin will not use the animation found on source objects unless explicitly told to do so. To illustrate how to turn on animation and master the different modes used to control playback, open the animation_exercises.max file included in the downloads for this tutorial. Once these exercise are completed, we'll apply these principles to the example scene.
This file contains a simple plane with arrows on it, the arrows are distributed with Forest Pack and laid out in a grid so that we can easily see the effects of changes to the animation controls. Also in the scene, to the left of the plane, are 5 animated objects that we'll use in later exercise. If you click on Manage Layers , you'll see there are 4 layers, one for each animation mode. Unhide the layer called 1 Follow Geometry.
To get started scrub the animation bar. Nothing happens. As mentioned above, this is because animation is off by default, so for the first step let's enable an animation mode and ensure that we can preview it in the viewport:
In these exercise files, to make things clearer in the viewport, Forest Pack has been set to display the scattered objects as meshes. If the geometry was more dense, or the scatter area larger this might not be possible. Fortunately Points-Cloud mode also enables you to preview animations, allowing you to get a good indication of the rendered results of more complex scenes. To illustrate this try the following:
Next we'll look at how to randomise the starting frame of the animated objects. This will allows you to use a single animated model to create a lot of variation by starting instances playing from randomly selected points offset along the timeline.
You'll notice when you activate Random Samples mode that the Time Offset and Count parameters become available. These are used to control the sample points along the timeline. To create the points, the Count parameter defines the total number of samples, while Time Offset determines the number of frames between them, starting from frame 0.
For example, if we use a Count value of 5 and a Time Offset value of 2, we get the 5 samples points marked in red in the diagram below. These start from frame 0 with 4 further samples each taken 2 frames apart. The bottom row illustrates the sample points on a 30 frame animation on the source object. In the resultant scatter, shown on the top row, you can see that only these 5 frames are used as a starting point at frame 0.
Let's try another example. In the illustration below, the Time Offset value has increased to 5 and the Count is now 6. This returns 6 samples at frames 0,5,10,15,20 and 25, randomly scattered by Forest Pack Pro.
(Note that the larger samples value has resulted in a more pronounced difference in the resultant animation.)
Understanding the Count and Time Offset parameters is the key to mastering this mode and the next, Controlling the starting frame using a map.
When playing pack the exercise files you'll notice that the animation stops at Frame 30. This is to be expected, it's when the source geometry stops too. In many case this may be the effect you're after, but if you want the animation to continue throughout the entire duration of the shot, you need to be sure that the source objects' animation is long enough. This is especially true when randomising starting points, as the source objects may need to continue animating well beyond the active time segment.
How this is resolved will depend on how the objects have been animated. Types of animation typically fall into two categories, either procedurally generated, for example wind animations created with GrowFX, Speedtree or another foliage modeller, or manually keyframed. In most cases procedurally animated geometry is ready to use without need for adjustment as it continues ad infinitum. For keyframed animations it may be the case that the animation finishes before the scene is over. When this is the case, you can either create a loop, or add additional keyframes. Below is a collection of tips about preparing animated meshes for Forest Pack.
Probably the easiest way to create a looped animation is to use the Parameter Curve Out-Of-Range options found in the graph editor. To illustrate we'll make the arrow animation repeat, instead of stopping at frame 30.
Instead of looping keyframed animation, some foliage animations lend themselves to noise controllers. Using these will create a lot more variation, avoiding the obvious repetition of a keyframed loop and the animation can never accidentally stop. To add a noise controller to create the arrow animation:
If you animate the rotation, translation or scale of an object and then add it to Forest Pack, you'll find that the animation is not used in the resultant scatter. This is due to some frightening matrix maths, fortunately there's a simple workaround. Instead of animating the object directly, simply add an XForm modifier and animate the Gizmo. This resultant animation is indistinguishable from animating the object directly and works flawlessly when added to Forest Pack.
Many rigid animations comprise a hierarchy of multiple parts. Ideally these should be combined into a single object before being scattered by Forest. Though Forest Pack can scatter groups, each item in a group is treated as an individual object. It is unlikely the original position and orientation of the elements will be maintained.
The easiest solution is to convert a collection of animated parts into a single proxy, this has the added benefit of caching the animation to disk so it's very fast to load compared to calculating animation on the fly.
In the included scene, instead of using a proxy for the Radio Telescopes, we've animated the 3 parts of the radio telescope using RailClone - it's a simple setup and there's nothing wrong with using animated RC objects in Forest Pack. The only step necessary to ensure the RailClone object renders correctly is to uncheck Display > Use Instancing Engine.
Instead of allowing Forest Pack to randomly distribute sample points you can use a grayscale map to precisely specify the placement of a sample point from which an animation will start. To illustrate this, if it's not already, open the animation_exercises.max file included in the downloads for this tutorial and do the following.
These kind of effects are great for animations of wind moving across grass, where you will often witness gusts travelling from one side of a field to the other. Before going any further let's take a look at how this works. As in the previous example, the sample points are controlled using Time Offset and Count parameters to determine the number and frequency of sample points. With this mode however, they are placed on the surface using a map. For example, using a Time Offset value of 5 and Count of 6 we get sample points (shown in red) of 0, 5, 10, 15, 20, and 25. In the top row you can see how a gradient map controls their distribution. The grayscale range is equally divided by the Count value with the first frame represented by black and the last represented by white. When the colour exceeds a threshold, the next frame is displayed. This explains why you can't see frame 25 in the top row as the gradient is only pure white at the very end of the row.
In this second example you can see that if you increase the Count to 15 and decrease the Offset to 2 you'll see a much smoother wave animation in the top row.
More or less any map that is calculated before render time can be used to offset the animation. In particular noise maps are quite effective for creating wind animations across grass and large areas of forest.
The final mode works a little differently. Instead of creating a number of equally spaced sample points along the timeline from which the animation will start playing, you define a range using Start and End parameters. A map is used to control the absolute frame displayed, based on a grayscale value. Scrubbing the timeline in this mode will not result in animation playback. Instead, to control the animation the grayscale value itself needs to change. Let's take a look at a couple of examples starting with a typical usage; a simplified growth animation.
In some situations you may may need a loop to play after the object has grown. This can be achieved by creating animated maps that loop only a portion of the timeline. As mentioned above, this object has a growth animation between 0 and 30 and a looped bend animation between 31 and 60. If we use a range from 0 to 60 in Forest pack this means that the first half of the grayscale gradient ramp will control the growth (rgb, 0,0,0 to 127, 127, 127), while the second half (rgb 128,128,128 to 255,255,255) will control the bend animation. This is easier to explain with an example:
If you play back the animation now you'll get a growth that transitions into a looped bend animation with some randomisation added by the noise.
If you are a V-Ray user it is possible to use VRayDistanceTex to drive animations based on their proximity to a list of objects. To do this:
If you are not a V-Ray user it is possible to get a similar effect as the previous example by using a Vertex Colour map. To do this follow these steps.
This example uses a couple of free scripts:
Blur Vertex Colour by Grant Adam is used to add vertex colours to a stack selection. It can be downloaded here.
Selection Cache Modifier by Peter Wajte enables you to cumulatively cache vertex selections. It can be downloaded from maxplugins.de. Just search for your max version.
Using this technique in combination with Peter Watje's Selection Cache modifier, it is also possible to "Draw" a growth animation using another object. To do this follow these steps:
We've gone into quite a lot of detail about how Forest Pack handles animated geometry, and explored the implications of this using a number of abstract exercises. To wrap this tutorial up we'll see how easy and quick it is to use Forest Pack to control animated objects. In this short section we'll use three of the techniques described above on a small animated scene to see how they apply in a typical situation.
To get started open either fp_animation_start_mray.max or fp_animation_start_vray.max depending on your renderer. In the file there are a number of hidden layers you can activate.
To follow along with the tutorial, If you have GrowFX installed unhide 1 Forest Objects Start GrowFX, otherwise unhide 1.1 Forest Objects Start Standard. If you'd prefer just to see the end results, unhide either 2 Forest Objects End GrowFX, or 2.1 Forest Objects End Standard. In all cases the Forest objects have been set up for you with the exception of the animation, which we'll add by following these steps:
Start by animating the simplest objects first. The Radio telescopes in the scene all move perfectly in sync. To do this use Follow Geometry mode.
The Follow Geometry technique worked well for the telescopes, but even with good transform randomisation, synchronised trees aren't going to look very convincing. Instead we'll use Random Samples mode to create animation variation. To ensure that the animation looks sufficiently differentiated, use a large Time Offset value.
Though that technique works well for the trees, randomising the offset for grass will look too chaotic. We want to simulate gusts of wind blowing across the landscape in waves, so in this section we'll create a custom grayscale map to use with Random From Map mode.
The video below demonstrates the final render, The sky and mountains in the background have been added in After Effects along with some basic post-production:
Using these techniques gives you a great deal of control when scattering animated objects, from simple synchronised animation, to advanced manipulation of offsets, and absolute playback using maps. In the last part we covered some basic uses in a real scene, but I hope that you can see the creative potential in these techniques and that they help you save time and produce great work! We'll be returning to animation in future instalments to look at more specific and unusual uses for these tools. In the meanwhile stay tuned for future Forest Pack and RailClone training, or for more information about many aspects of Forest Packs' features please see our reference section or visit the tutorials page for more Tips & Tricks videos and in-depth tutorials.