FBApplication().LoadAnimationOnCharacter

Anybody trying to retarget via script in MotionBuilder?

I can get this to work:

pFileName = r'C:/myPathToImportFile'
pCharacter = FBApplication().CurrentCharacter
pFbxOptions = FBFbxOptions(1)
pPlotOptions = FBPlotOptions()
app = FBApplication()
app.LoadAnimationOnCharacter(pFileName, pCharacter, pFbxOptions, pPlotOptions)

but it leaves the UI up, I have to click the ‘Open’ button on the UI to complete the task. Anybody know how to get this command to complete?

Thanks,

Try this:

pFileName = r'C:/myPathToImportFile'
pCharacter = FBApplication().CurrentCharacter
pFbxOptions = FBFbxOptions(1)

"""
Try Setting one of these
pFbxOptions.ShowFileDialog = False
pFbxOptions.ShowOptionsDialog = False
"""

pPlotOptions = FBPlotOptions()
app = FBApplication()
app.LoadAnimationOnCharacter(pFileName, pCharacter, pFbxOptions, pPlotOptions)

Thanks Seth,

This did it.

pFbxOptions.ShowOptionsDialog = False

Gonna take awhile to wrap my head around MoBu’s heavy OOP usage.

I just want to say that this forum is awesome, I did a google search for this exact same problem and bam! guess what’s the only place with a good answer.

A little better than here: http://area.autodesk.com/forum/autodesk-motionbuilder/python/ really.

I’ve noticed that when I do this, I get some straaaange behavior loading multiple files/takes (like, the anims and names are all mismatched, even the takes that were already in the file). So I have the box pop up between loads and it gets around the issue. Animators aren’t so happy :frowning:

Thank you forgoodcommunication.