Monday, December 17, 2007

Welcome to the obscure -- MoBuPy

Python for Motion Builder -- sometimes it's Python, sometimes, it's just Swigged C++
The docs (such as they are) appear to assume expert fluency in the MoBu SDK. I'll be
tidbitting here as I work on this stuff at the office and at home. Unless a search brought
you to this stuff, please ignore...

1) pyfbsdk FBSystem() returns an fbsystem instance whose Scene attribute is the
root scene, so:
from pyfbsdk import FBSystem, FBGetSelectedModels
fbs = FBSystem()
scene = fbs.Scene
chars = fbs.Characters # This acts like a python list (len, getitem)
all_models = fbs.Models
selected = copy.deepcopy(all_models)
FBGetSelectedModels(selected, None, True)
unselected = copy.deepcopy(all_models)
FBGetSelectedModels(unselected, None, False)

2) You now have root scene access, and dir(scene) will show you most of the other attributes
which will give you access to Actors, Materials, Textures, Meshes, blah blah blah

1 comments:

pierre said...

Yeah I can think of a lot of good uses for this! LOL.
Pierre