When setting up external custom Python libraries for use with MotionBuilder, if the application is having trouble finding
the external Python libraries, ensure the environment variables are set as follows:
- correct: c:/python/libs/custom/
- incorrect: c:/python/libs/custom
Following are the main ways to run Python commands in MotionBuilder:
- By executing individual commands in the Python Editor’s interactive console.
- By Starting MotionBuilder from the command line.
- A script can be assigned to a keyboard shortcut as a Python Editor shortcut, or as a global MotionBuilder shortcut. This is
configured in config\Scripts\ActionScript.txt. The file contains full instructions. See Binding shortcuts to a Python tool.
- From the Asset Browser via a custom path (right click in the navigation tree). When you drag and drop from the Asset Browser
to the scene you are prompted to execute, add to the scene, or both. Adding to the scene makes it accessible in the Navigator
under Scripts.
- At startup, from the Startup directory.
- From the Python Telnet console.
- With the Open Reality SDK C++ function FBApplication::ExecuteScript.
You can create scripts:
- With the Python tools provided with MotionBuilder. These include an editor and several script development tools such as autocomplete,
syntax highlighting, and an interactive console. These are collectively refered to as the Python Editor.
- In the text editor of your choice, or in IDLE, the Python integrated development environment.