Avoiding the UnbindWrapperError
 
 
 

Functionality is exposed to Python via a wrapper around the actual MotionBuilder object. For example b = FBButton() creates:

Once the two objects are created, the following states can arise:

You can register a callback on an object to be notified if it ever becomes unbound.

For an example of unbinding, see Unbind_example.py. It creates a tool and adds a label to it. It then calls DestroyTool, which deletes all the UI controls in the tool. But the Python wrappers (for the tool and label) are still accessible, and if you access the label caption property an exception is thrown.

You can also see the unbind error as follows:

  1. Add a cube to a scene and select it. Use the UI, or type in the work area: myCube = FBModelCube("Cube0")
  2. Delete the cube.
  3. If you now access the cube in the work area, for example: myCube.Name, this works because the cube persists in the undo system..
  4. Now do undoable operations in the scene which will replace the cube, for example by adding objects to the scene. After adding a number of objects, myCube.Name will throw an UnboundWrapperError.