Plotting Character Animation With A MotionBuilder Python Script . 

Image result for motionbuilder plot to control rig

Let’s go over how to use Python to plot animation onto a character’s Control Rig. The interesting part of this is the “plot options” and how we call back on them when we plot.


from pyfbsdk import *

# Defining our Characater as the currnetly selected one
lCharacter = FBApplication().CurrentCharacter

# Defining the Plot option that will be used        
PlotCtrlRigTakeOptions = FBPlotOptions()
# To use Constant Key Reduction on the plot (True or False) 
PlotCtrlRigTakeOptions.ConstantKeyReducerKeepOneKey = False
# To go through all takes in the scene and plot the data (True or False) 
PlotCtrlRigTakeOptions.PlotAllTakes = False
# Do you wish to plot onto frames (True or False) 
PlotCtrlRigTakeOptions.PlotOnFrame = True
# Set the plot period 
PlotCtrlRigTakeOptions.PlotPeriod = FBTime( 0, 0, 0, 1 )
PlotCtrlRigTakeOptions.PlotTranslationOnRootOnly = False
PlotCtrlRigTakeOptions.PreciseTimeDiscontinuities = False
# What filter to use on the plot (Unroll, GimabalKill or None)
PlotCtrlRigTakeOptions.RotationFilterToApply = FBRotationFilter.kFBRotationFilterUnroll
# Use Constant Kye Reduction (True or False)
PlotCtrlRigTakeOptions.UseConstantKeyReducer = False

# Plotting to the selected character - note "kFBCharacterPlotOnControlRig" and "PlotCtrlRigTakeOptions". 
lCharacter.PlotAnimation (FBCharacterPlotWhere.kFBCharacterPlotOnControlRig,PlotCtrlRigTakeOptions )

These are the settings I use when I am processing large motion capture data down to smaller performances.

Add a Comment

Your email address will not be published. Required fields are marked *