In the MotionBuilder UI, a model can be any object in a scene, created using geometry. Models can represent simple objects
like cubes, or complex objects like characters.In the MotionBuilder SDK, FBModel is a base class which is not used much directly,
but is the parent of important classes such as FBCamera, FBLight, and FBModelMarker.
It implements a number of widely-implemented functions and attributes
- Clone(), FBDelete()
- UI attributes such as Show, Pickable, and Visibility
- Positional atributes such as Rotation, Scaling, and Translation.
The following Python snippet shows how to create, show, scale, rotate, and delete a cube.
from pyfbsdk import *
myCube = FBModelCube("cube")
myCube.Show = True
myCube.Scaling = FBVector3d(40, 40, 20)
myCube.Rotation = FBVector3d(25, 16, 37)
myCube.FBDelete() There is a few ways to get a handle on existing models in a scene:
- FBFindObjectsByName and FBFindObjectsByNamespace return a list of objects matching a pattern (can contain *). For usage, see:
FindObjectsWithWildcard.py.
- If you know the name of the model, use FBFindModelByName, as demonstrated in FBComponent.py.
- FBGetSelectedModels can get a handle to an object which is derived from FBModel. It searches the scene for a model, based
on the model's unique name and returns a list of all the selected things in the scene.It searches the scene for a model, based
on the model's unique name and returns a list of all the selected things in the scene.
- FBSelectObjectsByNamespace selects (or deselects) objects in the current scene.
See also: ShapeCreation.py.