The following code sample illustrates how to open a file using FBApplication.FileOpen().
from pyfbsdk import * app = FBApplication() filename = "C:\Program Files\Autodesk\MotionBuilder 2012 (64-bit)\OpenRealitySDK\scenes\PlasticMan.fbx" # Open the sample file "PlasticMan.fbx", and prompt the user with a # UI dialog box, as indicated by the second True argument. app.FileOpen(filename, True)
Opening, Merging, Appending and Importing...
FBApplication provides several functions allowing you to control how the loaded data appears in the scene. The following table describes these functions.
Function | Description |
---|---|
FBApplication.FileOpen() | Opens the file, and replaces the current scene with the loaded data. This is equivalent to File > Open... in the application menu. |
FBApplication.FileMerge() | Opens the file, and merges its contents with the current scene. This is equivalent to File > Merge... in the application menu. |
FBApplication.FileAppend() | Opens the file, and appends its contents to the current scene. This is equivalent to File > Merge... in the application menu, with all options set to "append". |
FBApplication.FileImport() | Opens the file, and imports the animation data contained in the motion file. If the second parameter of this function is True, models matching by name in the scene will have their animation data replaced by the imported data. This is equivalent to File > Motion File Import... in the application menu. |