Python Scripting for MotionBuilder 2011 - Reference Guide (pyfbsdk)

Introduction

Welcome To Python Scripting

MotionBuilder provides scripting capabilities based on the Python programming language. By creating and executing scripts, you can automate repetitive tasks.

This document lists the classes and methods available for scripting MotionBuilder using the Python programming language. In this version, we have exposed a subset of the existing Open Reality SDK to Python using an almost identical class hierarchy with some Python specific enhancements and some Python additions (see pyfbsdk_additions.py).

The Open Reality SDK is mainly used to create new interactive tools, custom devices, import/export filters, shaders, and other specialized objects. Since scripting targets different tasks (such as automation, setup, and batch work), the necessary classes to perform some scripting jobs may not yet be available.

Requirements

No additional software is required to use scripting: MotionBuilder comes with a minimal Python environment. If you have already installed Python version 2.6.4, it is automatically available to scripts run within MotionBuilder.

Limitations and Restrictions

The Python module is an exposed subset of the Open Reality SDK and uses an almost identical class hierarchy. This introduces the following side effects:

The Python module has the following additional restrictions:

Custom modules

In order to use custom Python module, some setup may prove necessary. The simplest setup only requires copying your modules in the folder [APPLICATION]/bin/[platform]/python/lib for regular .py modules. Binary modules, such as .pyd for Windows should be placed in the folder [APPLICATION]/bin/[platform]/python/lib/plat-win.

Should a different layout be prefered, it will be necessary to use or modify the environment variables PYTHONPATH and PATH. Please refer to the Python documentation for more information.

Class Type

It is possible to determine if an object is of a certain class type using the function Is(int pTypeId) declared in FBPlug. The parameter pTypeId is a FBClassName_TypeInfo() function defined in each class of the Open Reality SDK exposed in Python. Simply replace ClassName with the appropriate class name to get the function for a type of object.

For example:

cube.Is(FBComponent_TypeInfo()) would return True

FBSystem().Is(FBModel_TypeInfo()) would return False

Default Parameter

If a class constructor has one or more default parameters, you must explicitly specify them when calling the constructor.

Future Releases and Feedback

In future releases, we will expand the scope of both the Open Reality SDK and the Python scripting features to answer your requests and requirements. With time, both the SDK and Python will provide complete access to MotionBuilder's feature set.

Your comments and feedback are very much appreciated and will guide further development of both the Open Reality SDK and scripting.

Thank you.

Warning:
This Python documentation has been automatically generated directly from the Open Reality C++ SDK documentation. Any errors, omissions or inconsistencies should be reported to ensure that it will be corrected in subsequent versions.

Distribution

Resources

The Open Reality distribution consists of the following:
Generated on Tue Feb 9 19:33:56 2010 for Python Reference Guide by  doxygen 1.5.3