from pyfbsdk import *
lStory = FBStory()
lScene = FBSystem().Scene
lcharactersList = lScene.Characters
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 = True
for lTracks in lStory.RootFolder.Tracks:
if lTracks.Selected == True:
lCharacterIdx = lTracks.CharacterIndex
lCharacter = lcharactersList[lCharacterIdx - 1]
lCharacter.PlotAnimation (FBCharacterPlotWhere.kFBCharacterPlotOnSkeleton,lOptions )
lTracks.Mute = True
for lFolders in lStory.RootFolder.Childs:
for lTracks in lFolders.Tracks:
if lTracks.Selected == True:
lCharacterIdx = lTracks.CharacterIndex
lCharacter = lcharactersList[lCharacterIdx - 1]
lCharacter.PlotAnimation (FBCharacterPlotWhere.kFBCharacterPlotOnSkeleton,lOptions )
lTracks.Mute = True