Creating Random Motion
 
 
 

This lesson illustrates how to use the Create Random Motion feature with clips in the Motion Flow Graph to create interesting scenarios quickly. It uses an available set of .bip motion files.

You’ll add four figure-skating motions to the Motion Flow Graph, create a network of transitions, and generate a random script to animate the biped.

Set up the lesson:

  1. Reset 3ds Max.
  2. In the Perspective viewport, create a biped starting at approximately 0,0,0.

Add clips to the Motion Flow Graph:

  1. Open the Motion panel.
  2. On the Biped rollout, turn on Motion Flow Mode.
  3. On the Motion Flow rollout, click Show Graph.

    The Motion Flow Graph displays.

  4. On the Motion Flow Graph toolbar, click Create Multiple Clips.
  5. From the tutorials\character_animation\motion_flow folder, hold down CTRL and select the following four motion files: Skateup.bip, SkateStart.bip, SkateLoop.bip, and SkateSpin.bip. Click Open.

    The motion files load into the Motion Flow Graph.

Arrange the clips:

  1. On the Motion Flow Graph toolbar, turn on Move Clip.
  2. Arrange the clips in a column with Skateup at the bottom, then SkateStart, SkateLoop, and SkateSpin.

Set and optimize transitions:

  1. On the Motion Flow Graph toolbar, turn on Create Transition From->To.
  2. In the Motion Flow Graph window, click and drag from one clip to the next to create transitions between the clips. Start with Skateup and drag to SkateStart, then SkateLoop and finally SkateSpin.

    Use the illustration as a guide to create the transitions. To create a loop, click a clip twice.

  3. Turn on Select Clip/Transition and region-select all the clips. Then, on the Motion Flow Graph toolbar, click Optimize Selected Transitions.

    The Transition Optimization dialog is displayed.

  4. Make sure Search Entire Clip is active and click OK.
  5. On the Motion Flow Graph toolbar, turn on Show Random Percentages.

    A percentage number displays next to each transition.

    You’ll alter the percentages for the loop transition and the transition between SkateLoop and SkateSpin.

  6. In the Motion Flow Graph window, right-click the loop transition arrow on the SkateLoop clip (not the box representing the clip).

    The Transition Editor dialog displays, with the name of the transition in the title bar.

  7. On the upper left of the Transition Editor dialog, enter 85 in the Probability field. Click OK.

    The random percentage next to the transition arrow is updated.

  8. In the Motion Flow Graph window, right-click the transition from SkateLoop to SkateSpin. On the Transition Editor dialog, enter 15 in the Probability field. Click OK.

    When a random script is generated, SkateLoop will be chosen over SkateSpin 85 percent of the time. The percentage numbers in the Motion Flow Graph are normalized, so if two transitions from a clip are set at 100, each one has a even chance of being selected.

  9. On the Motion Flow Graph toolbar, turn on Select Random Start Clips, and click Skateup.

    The Skateup clip turns purple. It will always be the first clip to play when a random script is created.

  10. Close the Motion Flow Graph window.
  11. On the Motion Flow rollout, in the Scripts group, click Create Random Motion.

    The Create Random Motion dialog is displayed.

  12. In the Minimum Animation Length field, enter 2000 and click Create. On the Unify Options dialog, click OK to accept the defaults.

    A random script is generated.

    NoteIf the biped's start position looks like it is floating above the grid, set the Start Position Z value to 0 on the Motion Flow rollout. This will position the entire animation back on the ground plane.
  13. Click Play Animation to view the results.

    The skater gets up off the ice and begins skating. Once the script reaches the SkateLoop clip it loops back to SkateLoop 85 percent of the time and SkateSpin 15 percent of the time.

  14. To get a bird's eye view of the entire motion, press H and select the biped center of mass (Bip01). Open the Modes and Display expansion bar on the Biped rollout. In the Display group, turn on Trajectories, then restart the animation.

    The trajectory of the scripted motion, as seen in the Top viewport

    NoteKeep in mind that, since you're using Create Random Motion, your motion will not necessarily look like the one above.
  15. Save the scene as MyMoFlow03.max.

Summary

Upon completion of this tutorial, you're now able to assign motion clips to a biped and adjust the transition between a clips or set up a looping operation for a clip. You also know how to create a random script for one biped or multiple bipeds. Finally, you created a random script that always start with a specific clip and some of the random clips have a greater chance of being used than others.