Motion Mixer Imagine you're animating a character in an everyday street scene. For the sake of argument, call the character Jim. Jim is walking down the street, admiring the sights, when out of the corner of his eye he notices a piece of trash on the sidewalk. He swerves to avoid the trash, then stops, backs up a step, bends down and picks it up, and then continues walking forward until he can toss the trash into a garbage can. Next, Jim spots a friend and stops to shake his hand. They start a conversation, which briefly turns intense, with both talkers waving their arms wildly in the air. Finally, Jim hails a cab and hops in.If you've done character animation, you can imagine how much work this seemingly trivial scene might require to animateit's quite a bit. Even after you've done the basic blocking, you'd have to spend a good deal of time fine-tuning the animation, adjusting keyframes and other settings ad infinitum until all the motions work together. But if you're using character studio, you can save yourself a lot of animation effort by exploiting the Motion Mixer feature.Using Motion Mixer, you could animate each action separately, save it in a .bip file, and then bring all the .bips into the Motion Mixer dialog and blend them together with an array of easy-to-use tools. In a sense, Motion Mixer works similarly to compositing programs like discreet combustion and Adobe After Effects, using a layer/timeline metaphor to let you freely combine pieces of a movie or, in this case, a 3D animation. (This process is often called nonlinear animation, or NLA, by analogy with nonlinear editing, or NLE.) It's one of the most powerful new features in character studio, and by following the lessons in this section, you can become familiar with its basic functions.Using Motion Mixer Access Motion Mixer from the Motion panel. With any part of a Biped selected, you click the Mixer button in the Biped Apps rollout to open the Motion Mixer dialog (Figure 15.37).Figure 15.37. The Motion Mixer dialog. [View full size image] The main part of the interface consists of a vertical array of tracks, each running horizontally across the center of the dialog. The tracks are organized on a per-Biped basis; you can control every Biped in the scene from a single Motion Mixer dialog. This central area is where you import motion clips in the form of .bip files. Once you've imported a clip, you can change the start point simply by dragging it horizontally. You can tile a clip so it repeats, and you can create and edit transitions between pairs of clips. This area also contains controls to let you mute and solo individual clips, adjust clip length either by scaling or cropping, and set Weight values that can vary over the length of the animation. But that's not all: You can also rearrange tracks and Biped groups by dragging vertically.The transition track merits special mention here. By default, Motion Mixer tracks are linear layer tracks, with one clip following another. The double-height transition track, on the other hand, lets you overlap clips and automatically creates transitions between them. One of the lessons later in this section shows you how to use the transition function to repeat a walk motion without skipping back to the original starting point each time.Following are brief descriptions of the remaining UI elements.The Motion Mixer Menus The menu bar across the top of the Motion Mixer dialog contains a number of important functions. It's arranged in hierarchical order, with the highest level of Motion Mixer elements at the left and the lowest at the right. Many of these menu functions are also available from right-click menus in other parts of the dialog.The Biped's menu commands affect all selected Bipeds in Motion Mixer. In fact, most of the commands aren't available unless at least one Biped is selected (that is, its label is highlighted). Here you can change the track color, delete a Biped and its tracks from Motion Mixer (caution: not undoable!), and set balance parameters so the Biped doesn't appear off balance. This menu also gives you the Mixdown commands, where you can create composites of the raw clips and copy the Mixdown to the Biped.The Trackgroups menu goes down a level in the mixer hierarchy, giving you commands that apply to selected Trackgroups. Of particular interest here is the all-important Filter command, which lets you specify which parts of a Biped the Trackgroup's clips should affect. You'll learn how to use this feature in the first lesson below.The next level down in the hierarchy gets you to the Tracks level, where you can influence individual tracks within a Trackgroup. Here you can add layer and transition tracks, convert between track types, optimize transitions, and import clips. If you import multiple clips at once into a layer track, Motion Mixer separates them by five frames each, and if you import them into a transition track, Motion Mixer automatically creates transitions for each.The Clips menu provides several useful functions, including the ability to replace any or all instances of a clip with another one. Even more powerful is the Time Warp function, which lets you change clip timing internally. You stretch out or compress time within a clip for the ultimate customizability in mixing motion. You'll find lots of information about using time warps in the discreet user reference and tutorials included with 3ds max 7.Last is the Transitions menu, which lets you edit and optimize transitions as well as convert a transition to a loopable clip that you can use to repeat a motion without transitions.The Motion Mixer Toolbar Just below the menu bar is the toolbar, with handy buttons for a range of Motion Mixer functions. Starting at the left end, you have buttons for adding and deleting Bipeds and for selecting, moving, and sliding clips. The two numeric fields, normally blank, show relative and absolute frame positions during manipulations such as scaling a clip. Next come commands for trimming clips, editing time warps, moving tracks vertically, and locking transitions. The remaining buttons affect the viewable area, enable snapping, and provide access to preferences settings and the reservoir, which serves as a clip library.The Mixer Mode Button An important fact to remember regarding Motion Mixer usage is that you won't see the effects of the animation that's set up in the dialog unless the Mixer Mode button in the Motion panel > Biped rollout is on. Normally, this button comes on when you access Motion Mixer by clicking the Mixer button, but it's possible for it to be off for various reasons. If you're using Motion Mixer and you scrub the Time Slider or click the Play Animation button but nothing happens, make sure the Mixer Mode button is on.Filtering Motion Now we'll work through some of the Motion Mixer's capabilities. First, let's tackle motion filtering.
1. | Start or reset 3ds max. In the Create panel, click Systems (Figure 15.38) and then Biped.Figure 15.38. The Object Type rollout for the Systems category.
 | 2. | In the center of the Perspective viewport, drag upward to create a Biped about 72 units high (Figure 15.39).Figure 15.39. The 72-unit Biped standing in the Perspective viewport.
Note | By default (in the United States), a system unit in the 3ds max measurement system is equal to an inch, so this figure is about 6 feet tall. |
| 3. | Go the Motion panel, and in the Biped Apps rollout, click the Mixer button. This opens the Motion Mixer dialog (Figure 15.40). In the dialog, you can see a single track for the Biped, named Bip01. As you'll see shortly, you can do quite a bit with this one track.Figure 15.40. The Motion Mixer dialog. [View full size image] First you'll set a few options so you see the same thing as what's shown in this section. Click the Preferences button; it's the second button from the right end of the toolbar. In the Mixer Preferences dialog, in the Clips group, turn on Scales if necessary. Also, in the Other group, turn off Balance Curves if necessary. Click OK to close the dialog. | 4. | Position the mouse cursor over the track so it resembles a cross, and then right-click and choose New Clips > From Files. | 5. | You'll start with a clip of a Biped walking backwards. From the project folder for this chapter on the accompanying DVD, open the walk_backward.bip file. The clip appears in the Motion Mixer window, but it doesn't quite fit at the default zoom level.Note | When you load a clip, Motion Mixer assigns it a random color. You can change all of a Biped's clips to another color with the Track Color command, available from the Biped menu. |
| 6. | On the Motion Mixer toolbar, click the Zoom Extents button (Figure 15.41).Figure 15.41. The Zoom Extents button in Motion Mixer.
You can now see that the clip is 108 frames, a bit longer than the default 3ds max animation length of 100 frames. Unlike the standard Biped function (Load File), opening a clip in Motion Mixer doesn't automatically adjust the overall animation length. In a little while you'll repeat this clip, so you might as well make the animation a lot longer now. | 7. | Near the bottom right of the max window, click the Time Configuration button. In the Time Configuration dialog, set Length to 500, and then click OK to close the dialog. | 8. | Play the animation. The Biped walks backward for 108 frames and then stops. You needn't wait for the program to play all 500 frames to continue. | 9. | Click Go To Start to stop and rewind the animation. |
Note | The instruction "play the animation" assumes that you then click Go To Start to stop and rewind the animation. | Next, let's look at the Motion Mixer filtering tool.
1. | Near the top left corner of the track, right-click the word All, and from the menu that appears, choose Filter (Figure 15.42). This opens the Trackgroup Filter dialog, which controls which parts of the Biped the tracks in the current group control. By default, it controls all available parts. Note that parts not present in the Biped, such as the tail, appear in the dialog but can't be activated.Figure 15.42. Right-click the All label and choose Filter.
 | 2. | Click the None button to turn off all the parts, and then click the Legs button to activate just the right and left legs and feet (Figure 15.43). Click OK to accept the change and close the dialog.Figure 15.43. Click the Legs button in the Trackgroup Filter dialog.
Note | The Trackgroup Filter dialog is modal, so you can't do anything else in the program while it's open. |
| 3. | Play the animation and then rewind it when the motion stops. The legs and feet move as before, but the Biped stays where it is. That's because all the movement buttons are off. | 4. | Reopen the Trackgroup Filter dialog. You can now see the Movement Filter buttons; they're the three arrow buttons under the big Spine button. From left to right, they filter horizontal, rotational, and vertical movement. | 5. | Click the Horizontal movement button to turn it on, and then click OK and play the animation (Figure 15.44). Now the Biped travels backward again, but there's something a little different about its motion.Figure 15.44. Click the Horizontal button to enable horizontal movement.
 | 6. | Play it again in the Left viewport (adjust the zoom if necessary), and watch the pelvis. The pelvis travels in a completely straight horizontal line, because the vertical motion created by the original walk animation is still filtered out. | 7. | Turn the vertical Movement Filter button back on and play the animation again in the Left viewport. Now the pelvis travels up and down as the Biped walks, creating a more natural-looking motion.Note | The walk motion was created by using the standard Biped function Create Multiple Footsteps and then moving the footsteps behind the character. The Footsteps functionality in Biped is dismissed as a crutch by many animators, but it can be a valuable starting point for many animation tasks. | Before leaving the Filter function, you'll try one last experiment. | 8. | Use the Trackgroup Filter dialog to turn off the Left Leg and Foot, close the dialog, and then play the animation. The Biped walks backward using only its right leg and foot. Not too realistic, but somewhat humorous. Before continuing, reopen the Trackgroup Filter dialog and click All to turn all the body parts back on. |
As you can see, Filter is a handy tool for isolating parts of a character's motion for combining with other motions. It can save you a lot of repetitive setup work. For example, if you've animated a Biped walking and waving, but want to use only the waving motion in a different animation, you can load the .bip file and then filter out everything except the waving arm and hand. You can even use filtering in Motion Mixer to combine different subanimations from the same .bip file with different timing.Tiling a Clip Say you want your character to continue a walk motion throughout an animation segment that might be longer than the original animation. This is relatively easy to do in Motion Mixer, as you'll see next.
1. | Continuing from the previous tutorial, right-click the walk_backward_1 clip and then choose Tile Range. Click Zoom Extents on the Motion Mixer toolbar to see all the copies (Figure 15.45). Motion Mixer has made as many copies as it can fit within the 500-frame animation length and placed them end to end in the current track.Figure 15.45. Tiling results in four copies of the clip. [View full size image] | 2. | Play the animation. The Biped repeats the backward walk all right, but when it gets to the end of a clip, it just jumps back to the starting point again, instead of continuing to walk backward from the current location. That's not quite what we had in mind. You'll use Motion Mixer's transition track functionality to make it right. | 3. | Press Control-Z to undo the Tile Range command, and then right-click the track (not the clip) and choose Convert To Transition Track. The transition track lets you sequence animation segments along the timeline and automatically creates transitions between them so that the motion continues smoothly.The walk_backward_1 clip now appears at the bottom of the transition track, with brackets above it. These brackets determine the amount of overlap between this clip and the one to which it transitions. In this case, the clip will transition to a copy of itself. You'll use the default transition length. | 4. | Right-click the track to choose New Clips > From Reservoir, and open the walk_backward.bip clip again. The Reservoir lets you easily reuse any existing clips in Motion Mixer. Motion Mixer places the new clip in the upper part of the Trackgroup, slightly overlapping the first clip. It also creates a transition, which is the darker bar between the two clips. This is where the software changes over from the first clip to the second (Figure 15.46).Figure 15.46. The walk_backward clip transitions to itself over 16 frames.
 | 5. | Play the animation; if necessary, adjust the viewport so you can see the whole thing. The first thing you'll notice is that the Biped doesn't return to its starting point before executing the second clip, which is what we wanted. You might also notice that there's a pause during the transition. You can fix this easily. | 6. | Right-click the transition, and then choose Optimize. In the Transition Optimization dialog, click OK to accept the default settings and perform the optimization.Now, when you play back the animation, the pause is gone. Pretty slick! And now for an even slicker trick: | 7. | Right-click the transition again, and then choose Convert to Loopable Clip. A loopable clip is one that ends at a pose very close to that of the starting pose, so you can tile it without any glitches in between. It's the animation equivalent of a seamless texture. | 8. | The program opens the Save As dialog and prompts you for a file name. Change the file name from the default, clip00.bip, to walk_backward_loopable.bip and then click Save. The two clips are modified and the transition is deleted, creating a new, loopable clip. | 9. | Finally, right-click the second, upper clip and choose Tile Range. |
Now, when you play the animation, the Biped walks continuously backward the whole way.Using Track Weights In the 3ds max List controller, you can use weighting to set the relative influences of controllers in the list. Similarly, in Motion Mixer, you can combine different tracks that control the same parts of the Biped and then set weighting to determine which track has the most influence at any given point in time. In this tutorial, you'll explore this and similar controls.
1. | Reset or start 3ds max, add a Biped, then go to the Motion panel and open Motion Mixer. | 2. | Add the walk_backward.bip file to the available track, as before. | 3. | In Motion Mixer, under the Bip01 label, right-click the All label and choose Add Trackgroup Below. A new Trackgroup appears (Figure 15.47).Figure 15.47. A second, empty Trackgroup appears under the first.
Note | You can use multiple Trackgroups to control a Biped, or combine tracks in a single Trackgroup; how you group the tracks is up to you. One difference is that you can collapse a Trackgroup by clicking the (minus sign) button next to the Filter label ("All"by default), but you can't collapse individual tracks. |
| 4. | Into the new Trackgroup, import the walk_forward.bip file. | 5. | Click the Zoom Extents button on the Motion Mixer toolbar so you can see all of both clips. The walk_backward clip is a bit longer. Make sure the Scales box is checked in the Mixer Preferences dialog. | 6. | Drag the right ends of both clips to the 100-frame mark. Note that each track's label changes to reflect its scaling. The upper track is 93 percent of its original length, while the lower track is 8 percent longer than before. | 7. | Play the animation. The Biped walks backward, as if the walk_forward clip didn't exist. Given two or more tracks with a weight of 1.0 (100 percent) affecting the same body parts, the uppermost track always takes hold. |
Now let's explore a couple of different quick methods to change this.
1. | At the left end of the first clip, click the "m" button (Figure 15.48). In this case, "m" stands for "mute," which works the same way as the Mute button in an audio-editing program: It temporarily turns off the track. Now, when you play the animation, the Biped walks forward, because only the second clip is in effect.Figure 15.48. Click the "m" button to mute the track.
 | 2. | Click the "m" button again to turn it off, and then click the second track's "s" button. To continue with the audio-program metaphor, "s" (for "solo") allows only the second track to control the Biped. Try clicking the upper "s" button and then the lower one again; they turn each other off. You can mute any number of tracks, but only one can play a solo. | 3. | Play the animation. Again, only the forward motion takes hold. | 4. | Click the lower track's "s" button again to turn off Solo mode. |
Setting Weights There are several ways to affect weighting. To modify it at the beginning of the animation, change the numeric value at the right end of the track. Make sure you are at frame 0 when this is done.
1. | Start by setting both weighting values to 0.5 (Figure 15.49).Figure 15.49. Use the spinners or keyboard to set both Weight values to 0.5.
The black line that previously ran across the top of each clip now starts at the vertical center of the left end of its clip and travels diagonally to the top of the right end. This line depicts how the Weight value changes over time (Figure 15.50).Figure 15.50. The weighting values increase from 0.5 to 1.0.
 | 2. | Play the animation. The Biped starts walking backward slowly and then gradually accelerates to the full speed of the first clip. You'll see why this happens in a moment. | 3. | At the right end of the first clip, click the "w" (Edit Weight Curve) button. The weighting line turns red to show that you can now create and edit different Weight values over the course of the animation. Also, the numeric value field for Weight becomes blank, because no vertices on the line are active.At this point, you can edit anywhere on the line except the start point; to access the first point, you have to turn off the "w" button. | 4. | Position your cursor over the red dot at the right end of the red line and click. The red dot turns white, and its Weight value appears in the numeric field. You can now edit this value, either by dragging the dot vertically or by editing the numeric field. | 5. | Set both Weight endpoints of each track to 0.5, and then turn off the "w" buttons.Tip | You can toggle all tracks' Edit Weight buttons by clicking the "w" button at the right end of the Motion Mixer toolbar. To select multiple weighting vertices, drag a rectangle over them. | The black lines are now horizontal, showing that both clips' Weight values are 0.5 throughout the animation (Figure 15.51). Can you predict the effect this will have?Figure 15.51. Click the weighting vertex to edit its value.
 | 6. | Play the animation. The Biped walks slowly backward, with much sliding of feet. This happens because the distances traveled in the backward and forward walk animations are mostly canceling each other out. However, because the backward walk motion contains more footsteps, it overrides the forward motion slightly. If both had the same number of steps, the Biped would walk in place. |
Animating Weights Next, you'll add vertices to animate the Weight values over the course of the animation.
1. | Turn on both Edit Weight Curve buttons again, and then position the mouse cursor over the center of the weighting line in the upper clip (Figure 15.52). The mouse cursor image becomes a thin, downward-pointing arrow with a starburst at the end.Figure 15.52. Ready to edit Weight values.
 | 2. | Click and then drag in any direction. When you click, a new vertex appears at the cursor location and then follows the mouse when you drag. You can move it anywhere between the two existing vertices, within the limits of the clip. | 3. | Position the vertex at the top of the clip at about frame 33, and then click in an empty area to deselect it. | 4. | Add three more vertices as shown in Figure 15.53. Remember to deselect each vertex after adding it so you don't accidentally move it when adding another.Figure 15.53. Animated Weight values in Motion Mixer.
 |
Now, when you play the animation, the Biped starts walking backward, then moves quickly forward, and then resumes walking backwards.As you can see from these few, limited exercises, character studio's Motion Mixer offers an unprecedented level of power for combining and editing character animations. There's much more to Motion Mixer; I strongly encouraged you to read the discreet documentation and work through the tutorials, and then spend lots of time experimenting to see how far you can go with mixing your own motions. |