Motion capture data pipeline
From Blue Mars Developer Guidebook
|
|
Back to Tutorials
This is the motion capture pipeline, assuming you have received mocap data in an .FBX file that uses the standard Blue Mars skeleton. This is actually the older method using the CryExport plug in for max. The process has become a lot easier if you first follow the Exporting the animation to Collada (.dae) tutorial and use our conversion tools (How to convert an animation from Collada (.dae) to .dba).
Step 1: In 3DS Max, go to File > Import and import the .FBX file that contains the animation. The only required option to check is "Animation", the rest is up to you. Be sure to Convert Incoming World Coordinate to Z if your mocap data is in a Y-up scene. This might cause your characters to face the wrong way, but we will fix that later.
Step 2: Select the entire skeleton hierarchy by double clicking on the Bip01 bone in the Schematic View.
Step 3: Go to File > Save Animation... and save out the animation as an .XAF file. You should use the same file name as the .FBX file but with the extension .XAF. Click on "Save Motion" to save out the animation. Now you can close this file. There is no need to save this file because we created a new .XAF file already.
Step 4: Now open up the .MAX character file. The character mesh should be skinned to the Biped skeleton and in bind pose. Double click on the root (Bip01) bone to select all the bones in the hierarchy.
Step 5: Go to File > Load Animation... and the Load XML Animation File dialog box will open up. Select the .XAF file but do NOT click Load Motion yet. (a) In the File drop-down box under the Motion Mapping/Retargeting section, make sure you have the correct .XMM mapping file selected. (b) If you don't have an .XMM file you can make one in the next step. Click on "Edit Mapping" (whether you have the .XMM file or not).
Step 6: The Map Animation dialog window should open up. At the top under Filters, make sure "Animated Tracks" is checked like above. (a) If you need to create the .XMM mapping file, you can do so now by scrolling down both the CURRENT: and INCOMING: columns under the "Map Track To Track" section of and double clicking on the same bone in each column (ie Bip01 in CURRENT and its equivalent bone in INCOMING) and then clicking on the <- arrow. (b) This will map the track so that the bone selected under INCOMING will have its keys mapped to the bone selected under CURRENT. Click "Load Motion" when you're done to load the animation. (c) Depending on how long the animation is, it can take up to ten minutes to load the file.
Step 7: Now open up the Time Configuration properties (a) and change the End Time of the animation to match the last frame number that has keys on it. (b)
Step 8: We must now make sure the character is properly oriented. Since Max is Z-up, characters can sometimes end up facing the opposite direction after loading mocap data to it. The correct orientation for characters is to face +Y. An easy way to know if your character is properly oriented is to change the camera to the FRONT view (you can use the hotkey 'f' to change view). (a) You should see the BACK of your character when you do.
If the character is facing you, then you will have to turn it around. First, select the root (Bip01) bone. (b) Then open the Motion rollout menu (c) and open the Biped section. (d) Click on the "Move All Mode" button, which is located on the bottom right of the menu. (e)
Step 9: To turn your character around, change the rotation of Z to 180. (a) It should look like the picture above.
Step 10: If the character's feet aren't touching the ground, you can fix this by adjusting the Z position offset. (a)
Step 11: Once the character is properly oriented and touching the ground, click on "Collapse" to freeze your changes to the offset. (a)
Step 12: Now we have to make sure the Locator_Locomotion is correctly set up. First select the Locator_Locomotion. (a) If this animation is for a walk cycle or any cycle that will move the character, skip down to Step 13a. Otherwise, keep reading.
Step 13: Open the Move Transform Type-In box. Make sure you are transforming in World space (a). In the Move Transform Type-In box, set the X, Y and Z values to 0 (b).
Step 14: Now change to the rotation tool and set the X, Y and Z values to 0 like you did before. (a)
Step 15: Now go back to the Motion rollout menu (a) and open the "Key Info" section (b). Make sure you are at the first frame of the animation, frame 0. Click on the "Record" button to set a key frame (c), and then set both Position Space and Rotation Space to "World" (d).
Step 16: Now go to the Utilities rollout menu (a) and click on "CryEngine 2 Exporter" (b). This will open up the exporter options.
Step 17: Select the Locator_Locomotion node (a) and under the "Object Export" menu, click "Add Selected" (b). If there is already something in the list, click on "Clear List" first (c). Then go to the "Bone Export" menu (d). Once again, if there is already something in the list, hit "Clear List" first (e). Then select the root (Bip01) bone (f), and click "Add Selected" (g). When you are ready, hit "Export Bones" to export the animation into a .CAF file (h). The .CAF file contains the bone animation data.
Step 18: You will have to add the .CAF file to a .CAL (Character Animation List) file to be able to run it in the Sandbox editor. You can use any text file to make the .CAL file. For each animation you want in the game, you need to add another line. The format of each line is:
UNIQUE_IN_GAME_ANIMATION_NAME = FILENAME
- filepath statements allow you to specify what directories are valid .CAF directories.
Step 13a: If you are exporting an animation that moves the character (such as a walk or run cycle), you must follow these steps. First, go to the first frame of the walk cycle. (a)
Step 14a: Then, select the Locator_Locomotion node (a). In the Move Transform Type-In, zero out the translations for X, Y and Z (b).
Step 15a: Switch to the rotate tool and zero out the rotations for X, Y, and Z. (a)
The next few steps are for the CryExport plug in, which we are no longer supporting. If you opt to use it, the following steps will help you export the animations. However, we are now using the .dba format for animations so you should export as a .dae file and follow these steps instead: Exporting the animation to Collada (.dae)
Step 16a: Now we need to set a key on this frame. Open the Motion Rollout menu (a) and expand the Key Info section. (b) Hit record to set a key (c), and set the Position Space to Body and Rotation Space to World. (d)
Step 17a: Now we have to set another key for the Locator_Locomotion at the last frame. Go to the last frame (a) and set another key frame like before (b).
Step 18a: Now, change the Position Space from "Body" to "World" (a).
Step 19a: Go back to the first frame (a) and change the Position Space from "Body" to "World" (b).
Step 20a: Now go to the Utilities rollout menu (a) and click on "CryEngine 2 Exporter" (b). This will open up the exporter options.
Step 21a: Select the Locator_Locomotion node (a) and under the "Object Export" menu, click "Add Selected" (b). If there is already something in the list, click on "Clear List" first (c). Then go to the "Bone Export" menu (d). Once again, if there is already something in the list, hit "Clear List" first (e). Then select the root (Bip01) bone (f), and click "Add Selected" (g). When you are ready, hit "Export Bones" to export the animation into a .CAF file (h). The .CAF file contains the bone animation data.
Step 22a: You will have to add the .CAF file to a .CAL (Character Animation List) file to be able to run it in the Sandbox editor. You can use any text file to make the .CAL file. For each animation you want in the game, you need to add another line. The format of each line is:
UNIQUE_IN_GAME_ANIMATION_NAME = FILENAME
- filepath statements allow you to specify what directories are valid .CAF directories.
Back to Tutorials

























