Using FBScene & FBSystem
 
 
 

The following sections describe how to use Python and C++ to perform MotionBuilder functions such as setting up scenes, manipulating objects, and working with characters.

To find a given functionality, start with the UI name, and search in the help. Usually (but not always) the UI nomenclature is consistent with the SDK. Spaces present in UI names are likely to be missing in the SDK.

One way to find names of properties is to set them to something unique, save the scene as ASCII, the search the text output for your unique name.

In MotionBuilder, the scene is the environment where your models exist. The scene contains models which you can import, select, transform, copy, tweak, and animate.

FBSystem gives you access to the root model of a scene, the media, materials, and so on that can be used in MotionBuilder. You can interact with the underlying system, for example the asset manager. You can also get system-related information such as system time.

You can get an FBScene object from the scene attribute of FBSystem.

To append a take to a scene, use the Python method append. You get the current take with FBSystem::CurrentTake.

All models in a scene are children of the RootModel property of FBSystem.

The FBScene class contains many attributes that you can use to access objects, e.g cameras, characters, lights, and takes, essentially everything you see in the Navigator in the UI. A project can only contain one scene, and if you try to create an instance of a scene you’ll get an error, so you must access the scene by getting a handle through FBSystem.

# incorrect
myScene = FBScene("myScene")
RuntimeError: This class cannot be instantiated from Python
# correct
myScene = FBSystem().Scene
for take in myScene.Takes:
 print take.Name
#or do it like this:
for myTake in FBSystem().Scene.Takes: 
 print myTake.Name

See also the C++ code sample in toolscene.