Using Softimage to animate a toy train
Making Willie Move


Part II of a two-part tutorial
By Paulo de Andrade

 

 

 

 

In this second part of our Willie, the Choo Choo tutorial we'll work on a few techniques used to animate our little friend. Since we'll be experimenting a lot, I encourage you to save your work frequently in case you need to return to a neutral position after all the Softimage Undo buffer has been used up.

The first thing we must do is create an easy way to move all the elements of our little train together. To accomplish that, we'll create a hierarchy that includes all the train parts by using the Parent tool. Nulls are great for this purpose since they are not rendered and can be used as convenient handles to the whole hierarchy. They also offer the capability of being offset without directly affecting the original positioning of individual parts, if so desired.

He Lives!
Click on the image below for QuickTime movie of the finished animation...
Go to Model > Get > Primitive > Null to create the null which will be the parent of our whole hierarchy. Next make sure the null is selected and click on Parent. Left click on each individual train component and you will end up with a complete hierarchy. When all parts have been included, right click to exit parenting mode. Click on CLEAN_ALL on the Schematic window toolbar to clean up your hierarchy. Notice that the eye structures, which include the eyeballs, pupils and eyelids are part of their own sub-hierarchy.

In Softimage terms, the main hierarchy is called a tree and the sub-hierarchies are called branches. Notice that when you press the space bar to make a selection, the middle line at the
bottom of the screen displays the actions performed by each mouse button. Left button selects a single node, middle selects a branch and right selects the whole tree. By utilizing these options, you gain speed and extra control when manipulating a complex hierarchy. If you had a humanoid, for example, and each arm was set up as a branch, you could middle-click on an arm sub-hierarchy to select it without affecting the rest of the hierarchy whenever you wished to move just that arm.

Right-click on the parent null and the whole train should be selected. Now, by dragging the null around you automatically drag the whole train with it. Using the Schematic view to select the null is the easiest way of doing it. But there may be times when you have to do this selection within a different view. To make this process easier, right-click on the null to select it and scale it up until it starts protruding from the train body. The bigger null is much easier to find and select.

One of the easiest ways of adding organic motion to a character such as this in Softimage is to use one or more lattices. To see how easy this is, select the whole train hierarchy (tree) and click on Model > Lattice > Branch > Create. A new screen will appear showing subdivision values and interpolation options. The number of subdivisions will dictate how many control sections the lattice will have. If you need to exert very precise control over specific parts of an object than this number should be set higher. High numbers are not always better, though. Smaller numbers make it much easier to manipulate larger parts of an object by moving just a few lattice points. In our case the default values of 4 should work just fine. I do encourage you to play with those values later on in order to see how they affect the manipulation of your objects.

After clicking OK you'll see a yellow subdivided box surrounding your complete train. This is the lattice. One of the easiest ways of manipulating a lattice is by using tagged points. Let's try this out by going to the top view, holding the "T" key on the keyboard and dragging a rectangle around the three front rows of points on the lattice (subdivisions).

Go into Tag mode and enter rotation mode by pressing the "C" key on the keyboard. To make Willie "look" for something, middle-click and drag the mouse to the left and right. Notice how all the parts of the train rotate and get distorted as a whole. Experiment by using the other mouse buttons to manipulate the lattice in different axes. As you can see, you can easily pose your objects to create very cartoony animations by using lattices. Experiment with scaling and translating the tagged lattice points to see the other types of effects that can be obtained. We have tagged a large section of the lattice and are, therefore, moving the whole front part of the train. You can select just one row for more localized control and, in some situations, just a single point. If you manage to distort your object beyond control or simply want to go back to the original shape of your object all you have to do is go to Lattice > Branch Reset.

Lattices are also great modeling tools since they can be used to shape an object and then be frozen to keep the object's shape. To freeze a lattice, go to Lattice > Branch Freeze.

If you want to get rid of the lattice altogether then go to Lattice > Branch > Remove. This will completely delete the lattice. If you want to temporarily deactivate a lattice you can select Lattice > Branch > Deactivate. The lattice will still be there with all its settings, but will not affect the tree. To reactivate the lattice, go to Lattice > Branch, Info and select the Activate button.

Animating branch lattices is very easy. All you have to do is go to the desired keyframe, manipulate your lattice and then go to Motion > SaveKey > Object > Branch Lattice. Move to the next keyframe and manipulate the lattice again. Then save the keyframe as described above or by right clicking on Motion > SaveKey (right clicking on a command repeats the previous action, saving the animator some time).

We have created a lattice that affects the whole tree, the Branch Lattice. But we can also create lattices that affect individual components of the train. By using these localized (Node) lattices you can add precise local control to your scene. Let's try this out. First we will deactivate the Branch lattice, as it has precedence over Node lattices and the latter don't show up on all views. Select the chimney object only from the train tree. Next select Model > Lattice > Node > Create. Accept the default values. You now have a lattice just for the chimney. Tag the top three rows and rotate them backward as in the image below.

Now select the whole train hierarchy and reactivate the branch lattice. Notice now that when you manipulate your branch lattice, the chimney retains its local shape. There is one catch, however. If you pay close attention you'll notice that manipulations affect all the tagged points in all lattices. Therefore, if you left the points on the chimney lattice tagged, or if they were tagged while you tagged the branch lattice points, the transformations will also be applied to the node lattice, using the local values. If you apply a rotation, for example, the node lattice tagged points will also be affected by the transformation and the object will lose its original shape. In order to fix this, you can make sure that the branch lattice has the necessary points tagged before it's deactivated, as they'll be back when it is reactivated. Manipulate the node lattice and untag all the points. Reactivate the branch lattice and you'll be able to manipulate it while retaining the local lattice's original shape. By activating and deactivating node and branch lattices, you can achieve the perfect combination of tagged points. A more elegant way of doing this would be the creation of clusters, but this function doesn't work with lattices.

I mentioned earlier some of the advantages of having a null as a parent of a hierarchy. We'll now use it as a handle for our little train, guiding it along a path. First deselect the train hierarchy. Then select Model > Draw > Curve > B-Spline. On the top view draw a curve, starting at the world origin and the center of the train and extending it towards the front and sides of the train, making sure you have many turns for the train to follow. Next select just the parent node (null) of the train hierarchy. Go to Motion > Path > Pick Path and click on the newly created curve. A dialogue box shows up enabling you to set the start and ending frame of the path animation. Use the default numbers, which correspond to the total number of current frames. Drag the slider at the bottom of the screen and you'll see the train following the path. One thing is wrong, however: The train keeps facing the original direction, not the direction of the curves. In order to fix this, we'll tangency constrain the null to the path. With the null selected, go to Motion > Constrain > Tangency and click on the path. Your train probably jumped 90 degrees clockwise. If that's the case, it's not a problem. Just hit the "C" key on your keyboard to enter rotation mode and drag your middle mouse button until the train is facing forward again. Now drag the slider at the bottom of the screen or press the play button and watch Willie merrily following his path.

For the last part of our tutorial we'll make the wheels rotate automatically as the train advances on its track. This can be accomplished by setting up an expression for the rotation of each wheel. In order to set up the expression, we must first know the exact length of the path. Go to Motion > Info > Measure and select Length. Then click on the path. Write down results and delete the effect icon (looks like a ruler). Next we need the circumference of the wheel. We have two types of wheels -- small and large -- therefore we must measure both and apply the measurements to the corresponding expression. To measure a wheel select it and use the Info > Distance tool. Click on one point at the edge of the wheel and then click on the opposing point directly across the wheel, not letting go of the mouse button. The measurement will show up at the bottom of the screen for as long as you hold down the button. Write the number down repeat the procedure for the other type of wheel. Then exit measuring mode by pressing the right mouse button.

Select the first wheel, go to the first keyframe and select SaveKey > Object > Rotation > Z. This creates a function curve for the wheel rotation, which is necessary for the expression. With the wheel still selected, go to Motion > Expressions > Edit. If you have never entered an expression, here's how it works: The affected element field displays the name of the selected object. After the period that follows the name, you enter the fcurve to be affected. You can enter it directly or you can select from the Fcurves list by pressing the Fcurves button. Select rotz. Now jump to the Expression field and open parentheses. Click on the Scn Elements button and select the null that you used as a parent for the train hierarchy. With you cursor after the period click on the Fcurves button and select trans. Type a division sign (/) and then the number 100. Close parentheses. Type a multiplication sign (*) and open another parentheses. Type a negative sign (-) and the number you wrote down corresponding to the length of the path. Next type another division sign followed by the number corresponding to the diameter of that wheel. Close parentheses, enter a multiplication sign and then the number 360. Click on the Validate button to validate the expression.

If everything went well the message Valid Expression will appear after Status. What this expression means is that wheel's Z rotation equals the train's percent position along the path (null.trans/100) times the length of the path multiplied by the wheel's circumference and converted into degrees. The negative sign in front of the path's length was necessary because the path went from positive to negative Z. To apply the same expression to the wheel at the opposite side of the train all you have to do is select that wheel and then Motion > Expressions> Copy. Then click on the wheel you just entered the expression for and the expression will be copied to the new wheel. Make sure you enter the correct diameter in the expression for the different size wheels. Once all the wheels have the correct expressions, you can move the animation slider and the wheels should automatically turn according to the train's motion, including the acceleration and deceleration at the star and end of the path. If you are having a hard time visualizing this motion, then select one wheel and tag one point at the outside edge. Now you can move the slider or press Play and observe how that point changes relative to the wheel's rotation.

You can combine all the techniques discussed above to enhance your own animations. The lattice can be used, for instance, to make the little train rock from side to side as it moves. Experiment and enjoy!

 

Paulo de Andrade has been animating in front of a computer for over 16 years. As a result of the exposure to such large amounts of monitor radiation he has lost most of his hair and actually glows in the dark, which forces his wife to sleep wearing sunglasses. Paulo can be reached at pdeandrade@digitalmedianet.com.