Skip to content

Instantly share code, notes, and snippets.

@leestuartx
Created June 13, 2015 06:48
Show Gist options
  • Save leestuartx/1c2e42d163970be8200d to your computer and use it in GitHub Desktop.
Save leestuartx/1c2e42d163970be8200d to your computer and use it in GitHub Desktop.
Auto Plot all takes in MotionBuilder
from pyfbsdk import *
lSystem = FBSystem()
lTakeIdx = 1
'''
Actual loop to move through takes
'''
for newTake in lSystem.Scene.Takes:
#Display next take
#print "current take is ", newTake.Name
#Open next take
lSystem.CurrentTake = newTake
#process next take
## Plot the character animation to skeleton
lcharactersList = FBSystem().Scene.Characters
lchar = lcharactersList[0]
print lchar.Name
lOptions = FBPlotOptions()
lOptions.ConstantKeyReducerKeepOneKey = True
lOptions.PlotAllTakes = False
lOptions.PlotOnFrame = True
lOptions.PlotPeriod = FBTime( 0, 0, 0, 1 )
lOptions.PlotTranslationOnRootOnly = True
lOptions.PreciseTimeDiscontinuities = True
lOptions.RotationFilterToApply = FBRotationFilter.kFBRotationFilterGimbleKiller
lOptions.UseConstantKeyReducer = False
lchar.PlotAnimation (FBCharacterPlotWhere.kFBCharacterPlotOnSkeleton,lOptions )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment