Christian Perry []

XSI > FBX > Motion Builder Notes

There have been a number of posts regarding XSI and Motion Builder so I decided to share some of my experiences with this process. Hopefully it will be helpful.

For our recent projects we really wanted to use a more complex rig than the very basic skeleton that is created with the Kaydara script. The workflow that has worked the best for me is as follows. It looks complicated but once the workflow is set up it works beautifully and gives you a level of control in XSI to further manipulate motion that is not possible with the Kaydara skeleton because you will have the power of an advanced rig design. I am attaching some simple example scripts that I use in the step by step process below.


Create Rig from Biped Guide with Shadow Rig.
Remove constraints on Shadow Rig (Biped_Skeleton).
Build constraints from Biped_Rig to Biped_Skeleton.
Create new scene with your character weighted to the Biped_Skeleton. Rename and scale bones to appropriate Motion Builder names. Export FBX. Apply motion in Motion Builder. Merge FBX back into XSI. Revert naming and scaling to original XSI values. Plot motion to the constrained Biped_Rig. Remove constraints on Biped_Rig. Export final motion clip from Biped_Rig for use in scenes with your
character weighted to the Biped_Rig.

Step by Step:

1) Create biped rig guide (Get>Primitive>Model>Biped Guide) manipulate the rig guide to match your character.

2) Create rig from guide (Animate>Create>Character>Rig from Biped Guide).

3) Choose the options you want then also activate the shadow rig option. I Like to use SI|3D Skeleton and the No Fingers option on the hands.

4) Once your rig and skeleton are created you need to relax the constraints on the skeleton since we will be reversing the constraints in a later step (Animate>Character>Constraints Outside Model Boundaries>Remove).

5) Export three different models: BipedPropGuide, Biped_Rig, and Biped_Skeleton. We will be importing these into different scenes so it is nice to have them external. I export the Biped Guide in case I have to back up and re-create the skeleton and rig again.

6) Create a new scene and import the Biped_Rig and Biped_Skeleton models. We now need to create a series of constraints for the Rig to follow the Skeleton. For the most part I have found that pose constraints work the best for my needs with CnsComp turned on while setting them up so that the offsets are automatically created. Depending on the setup of the rig and the motion you are trying to create this can vary greatly. I have attached an example script (BipedCnst) that will build the constraints between a non FootRoll Rig and a shadow skeleton. If you are using Motion Builder's floor contact, which is excellent by the way, this is the setup that is easiest. If you want more control in XSI a FootRoll rig is ideal but a little more complicated in the constraints setup and you won't get accurate foot motion from MotionBuilder. In the example of the attached script it uses the Isner spine for the spine and neck to solve for motion rather than explicitly taking it from the shadow
rig spine. I prefer this setup for additional motion manipulation in XSI since the Isner spine solves very well for human spine motion. Create a group with all of the elements in the Biped_Rig that are constrained to the Biped_Skeleton. This will be used later.

7) Save the scene created in step 6 with a name such as Constrained_Transfer_Rig.

8) Create a new scene and import your Biped_Skeleton model and the character that it will be animating. Envelope your character to the Biped_Skeleton. You can do some basic weighting if you want to but this is only for visualization in MotionBuilder so don't waste too much time. I like to strip all the materials and textures from the character since the FBX plugin is horrible at transferring UV's. We have found it best to just visualize in MotionBuilder with the default grey.

9) Save the scene created in step 8 with a name such as FBX_Base.

10) Since Motion Builder is very picky about the naming of the skeleton structure you have to either re-name all the bones in Motion Builder before you can characterize it or you can re-name in XSI. I chose the latter because you can script it. Another limitation of the FBX plugin is that it will not allow you to scale the scene. The unit sizes we were working with in XSI when exported to Motion Builder would make our characters come in extremely small. Therefore, I also scale everything in the script. Attached is a renaming and scaling script (MB Biped Export) that will work for a rig created in the steps above. Note that these attached scripts are very basic, they are simply a copy and paste of the manual process so you could very easily create your own with very little scripting knowledge (such as myself).

11) Run the script from step 10 or rename manually in XSI or Motion Builder.
Note: An easy way to see what Motion Builder will want is to run the script that creates the Kaydara Skeleton (Installed with the FBX plugin).

12) Save the scene created in step 11 with a name such as FBX_Export.

13) Export your scene to FBX (File>Export>FBX file)

14) Import your FBX file into Motion Builder and apply and manipulate your motion. Export back to a FBX file. Note: we have found that you have to export exactly as you imported, meaning that you have to strip anything out of the scene other than the character and skeleton you imported from XSI. The other method is to select all of the XSI character and skeleton elements and choose export selected.

15) Load in XSI the FBX_Export scene created in step 12

16) Merge in the motion from the FBX file (File>Import>FBX file). This will take a minute as the FBX plugin if very slow. If all goes well you should now have motion on your skeleton.

17) We now want to revert the re-naming and scaling we did in step 10. Attached is a script which is essentially the reverse of the script in step 10 (MB Biped Import). You should now have the original XSI names. This step makes it easier to use the motion clip in the following steps rather than having to create a connection template since it is scriptable.

18) Branch select the entire Biped_Skeleton hierarchy and create a motion clip (Animate>Actions>Store>AnimatedParameters - Fcurves).

19) Save the motion clip externally that was created in step 18. You can do this by locating the motion clip in the explorer (easiest to filter by mixers only). Click on the clip icon to open it in the property editor. Click on Save in the upper right corner to save it externally.

20) Load the Constrained_Transfer_Rig scene created in step 7. Branch select the Biped_Skeleton and open a mixer window. Open a browser and drag the motion clip exported in step 19 into the mixer. If everything is named correctly it should import right in, if not it will pull up a connection template for you to rename.

21) Select the group created in step 6 containing the constrained elements in the Biped_Rig. Plot the motion to the rig (Animate>Tools>Plot>ConstrainedTransforms). After the plot is complete it will ask if you would like to automatically delete the constraints, select yes. If you set up the pose constraints properly with only the appropriate rotation, translation, or scaling options active then it will only plot what is active. If you didn't, you have to manually remove any plotted animation on a transform that is not wanted, for example: translation on arm bones. A new feature in version 3.5 is the 'Process rotations to ensure continuity' option in the plotting dialog. This is a gimbal lock killer which is very helpful in many situations.

22) Once your motion is plotted and all constraints removed you can now create a motion clip for the Biped_Rig and export it externally as we did for the Biped_Skeleton in step 19 for use in a scene with your final character that has detailed weighting to your Biped_Rig.

The beauty of this process is that you can create a library of motion clips that can be used on any biped rig, created in a similar manner, in the mixer or applied as fcurves. You then have the power of additional animation using a well built rig for use in the mixer or for cleaning up mocap.

There are a couple of bear traps that we have not found a way around yet. From my experience it seems to be a problem with Motion Builder since we have duplicated it in Maya and Max. At all costs try to avoid layering motion in Motion Builder. There seems to be huge rotational problems that are randomly introduced when exporting motion that has had heavy blending in Motion Builder. In my experience the best results seem to come when you use Motion Builder simply as a conduit to get in MoCap data and only use a few of the tools for cleanup, maybe some filters and floor contact. Any time we have gone beyond this there are major problems. Perhaps when Motion Builder is more mature this will not be an issue. However, anyone competent in XSI will have access to much more power in the mixer and other animation tools than Motion Builder currently offers. Personally, I prefer the cleanup tools in XSI's fcurve editor to Motion Builders.

Best of Luck!

Christian Perry