Mocap Cleanup

Overview

Though mocap cleanup may at first seem to be a relatively easy task, if the wrong approach is applied, estimated times to clean up rise beyond practical limits and the end results look poor. The most important first step is to make sure the approach is correct from the beginning.

Each take usually has its own special requirements, but there are some global rules, which apply to a majority of the work that needs to be done. The first rule is not to delete keys just because something doesn't look right. This should only be employed when the data cannot be fixed in any other way.

Sample File: combat_toProne_rifle_01.bip

Important Note 1: General workflow is when completing a motion using IK, to resave the bip file using "a keyframe per frame" option and turning off "save max objects". This will save the motion with a keyframe for every frame, but will disengage the IK setup in the motion. This is to avoid issues with loading a bip file on a max file that has another IK object selected, ruining the motion.

Important Note 2: When working with layers on large files, collapsing a layer can take a long time if the time configuration is set to encompass the entire range of the animation. A collapse, curiously, is much faster when setting the time configuration to something small e.g. 0-10 rather than the animation length e.g. 0-1300.

Initial Cleanup

The first step is to cleanup the mocap as closely as possible to the original capture without pasting any game poses.

  • Transfer the motion from Motionbuilder using the transfer script (max 8) or using exclusive merge (max 9). In most cases animators will be given biped files so this step is not always necessary.
  • Run a rotation blur filter if necessary starting from the root (though not always needed), running up through the spine bones and down through the arms. General rule with filters is, if you are not sure, run the filter and then preview the results. If things look worse, undo the operation.

  • A position smooth or blur may be required on the root, though this is rarely needed.
  • Hands usually contain the most noise since it becomes collective down the chain of parent bones. Run the filter with stronger settings or just run the filter several times.
  • When takes are processed with Motion Builder, if the mapping was incorrect, the clavicles are sometimes not rotated high enough. When this transfers to a biped the clavicles are unnaturally rotated downwards. Select the clavicles, add a layer and correct the rotation. Collapse the layer.

  • Next step is to rid the character of its unnaturally posed hands/fingers. Create a layer and paste something like "open hand" posture on both hands. The fingers will now look more natural. This is not the final solution to the hands. Later you can come back and work on them some more. Collapse the layer.

  • Next you need to correct any rotational problems with the feet. Normally these shouldn't exist, but it depends on how well the character calibration was in Motion Builder. Create a layer, fix the rotations, and collapse the layer.

  • If the root is too high at this point and the feet are not touching the ground, this needs to be corrected. Select the body vertical tool. Again create a layer, move the root down so the feet touch the ground and collapse the layer. Collapsing at each step is important and will be described later on.

  • If the hands need to be locked to a prop like a weapon, make sure you place the hands correctly, select the left hand and select the Bip01 R Hand as the IK object in the key info display. This way whenever you set a planted key, the left arm will follow the right arm at that point. Since mocap data has a keyframe for every frame, you need to set planted keys for the entire range that the limb needs to be locked. Use the Align Operation script in AnimTools to lock your biped limb to the prop for the entire range it should be attached to the weapon. This is useful for keeping the rotational direction of either the elbow or knee. Try not to delete keys and lock limbs for whole ranges. This destroys the underlying data that you are trying to preserve.

This completes the first step to cleaning the mocap data. These steps are valid for all capture takes. The next few steps will take a more specific capture (combat_toProne_01 transition) and find what the best approach is for that particular motion.

Cry Plant Key Script

For animation that requires large amounts of keys to be re-planted, a script was created to do this automatically. This way ranges of keys for the feet or hands can be locked down solidly over a specified range of time, while retaining the original angle of the knee or elbow from the raw mocap. This helps avoid using the more brutal method of deleting a range of keys and planting only the first and last frames, removing any trace of the original angles of the knee and elbow.

This is extremely bad and usually ends up in the animation being rolled back to an earlier state to start the cleanup process from the beginning. This is why it is extremely important that you don't delete keys.

Installing the Script

See documentation on CryAnim Tools.

Using the Script

As mentioned in "Specific Approaches", when the time comes to plant/align many keys over a range in time to stop small (or larger) drifting of the arms and legs, this script becomes invaluable. Detailed information is located at the bottom of the AnimTools branch in the "tutorials" section. General workflow is as follows:

  • Shift to a point in time where a foot or hand needs to be planted for a range in time.
  • Set the begin and end times of the range that should be planted.
  • Click Apply, Begin/End or Range and the script will run through and set a planted key, sliding key or align to a snapshot on each frame.

Specific Approaches

  • After completing the above steps on this file, you need to start correcting how the legs are placed on the ground. You can either layer the legs/arms - additively correcting these, or another way is to subtly rotate the root at times to correct major errors, which would take much longer to correct in any other way. For this particular example a good frame to "lock off" is frame 40. At this point the arms and legs are correctly aligned to the ground. You need to lock this pose by creating a layer, copying the pose and pasting it at this point in time. This will preserve the motion behind this point in time and allows you to edit freely after it.

  • At frame 48 there is a problem with the right arm and leg as they are penetrating the ground.

  • This can either be fixed by layering the legs and arms, but a quicker way is to rotate the root slightly.

  • Remember though that each different mocap has its own requirements. This method may work here, but not for another file. This is where you need to evaluate which approach is best.
  • Moving along further in time, you see that the body in general is starting to dip beneath the ground plane. You need to select body vertical and correct it at this point in time, much like the previous step. Since frame 48 looks roughly LK, you can copy and paste the pose (the modified pose that is) and lock its position at this point in time. Now move forward to the offending (bad) frame, in this case frame 56.

  • Select body vertical and move the biped upward so the knees and arms on the ground plane.

  • Do the same for any point in time where ground penetration is extreme.
  • The next step is to pass through the animation and start to lock things like the hands at the points in time where they plant on the ground. Before doing that, you need to correct the hand poses, so that when you lock them with IK they will look correct. For instance at frame 48 the hand is positioned on the ground, but because you pasted the open hand pose from the poses file, it doesn't plant on the ground correctly. You need to flatten the hand with a layer.

  • After correcting positions through the entire animation, collapse the layer. You need to then start setting planted keys so that the hand will stay in place when you need it. Again do this on a per frame basis so that the elbow or knee rotations are not lost. See information in the section "Using the Script" or the AnimTools tutorials.

This completes part 2 of the cleanup for this specific file. These principles can be used on many capture takes such as vehicle enter and exit animations and other types of motions. The next section will deal with a more generic finalization of this particular file, but is a technique that will be used on all takes in order to make them "game compatible". you need to paste your game poses on these motions.

Making the Motion Game Compatible

This is one of the most important steps of the process. Even if all of the previous steps were handled perfectly, if the next step is not handled in the correct way, the motion can be almost totally destroyed, adding many unnecessary hours of additional work.

  • First is a screenshot of the cleaned mocap data without a game compatible pose pasted on it.

  • Next you need to create a layer and paste our game pose on the file. In this case, combat_idle_rifle.

  • The pose at this first frame now looks as you need it to for use in the game. If you play the motion at this point though, it will contain some wild feet sliding and arms flailing. This is where the previous stages become important. What you want to do is to blend from our game pose into the underlying mocap data. In this way you preserve as much of the original mocap as possible, while still being able to start in the poses that you made for the game. Move forward in time to the first frame where the motion looks unnatural (usually not more than 50 frames or so). In this case the motion is already looking strange at frame 17.

  • What you need to do is go below the layer (do not collapse) and copy the underlying pose at this point in time.

  • Hit the black down arrow in the layer control. This will take you to the base layer. Copy the pose at this point.
  • Hit the up arrow in the layer control. This will take you back up to the layer where you have pasted the game pose. Paste the previously copied pose from the base layer. The motion now blends in from our game pose to the underlying mocap data. Preview the motion - it looks much better. This is why the previous 2 steps are very important in helping this final stage. Initial cleanup is important as you want to blend into this motion. In some cases you need to manipulate the motion so that it fits with the feet on the first frame with the game pose. In this case, the initial cleanup (before pasting the pose) needs to be positioned as closely as possible to where the feet are positioned in the game pose.
  • Now you need to apply this technique to the end of the mocap take so that you can tail out of the motion back into our game pose to have a perfect loop, or in this case perfectly matching the prone pose. Here you need to lock the pose at frame 68. As in previous examples this is simply just copying the pose as it is at that point and pasting it on the layer "locking" the motion in place, so that edits made after this point in time will not affect the motion behind it.

  • In this example frame 68 has been locked out. Move forward to the end of the animation and paste the prone pose as it is in the poses file. In this file frame 84 is a good point to finish the motion.

  • Because this motion has translated the character forward in world space, you need to preserve this translation so that the mocap is as close as possible to the original. Because the animation system allows you to translate motions, you don't necessarily need to keep the character at the origin when an animation ends. After pasting the pose the entire character translates back to the origin. Since you don't want this, you need to select the body horizontal and delete the key frame (in 3ds Max 8 and later versions paste the pose without the horizontal lock). You will see the character snap forward in world space, closer to where it was in the original mocap. Play the motion.

What you have done in this case is to blend from our game pose, into the underlying mocap. You have blocked out a section in time from frame 17 to frame 68 which preserves the mocap data after its initial cleanup stage. From frame 68 you then blend back into the game prone pose which finalizes the major section of cleanup. After this, some minor corrections may be needed to hands and feet using the align to snapshot tool, a part of AnimTools.

For motions which have the character end in a rotated state, an additional step is necessary. Select the body rotation function, select world coordinates and rotate the character from its normal game pose direction, to the rotation that the mocap ends in. This will preserve the rotation of the mocap without too much additional editing required.

Again, these steps use one motion capture file as an example. There are many other types of files which have different needs.