This reference page is linked to from the following overview topics: MotionBuilder 2014, MotionBuilder 2013, Running Python Programs, Your First Python Program, Object Model, FBSystem - The System Class, FBApplication - File I/O and Application Utilities, File Input and Output, Saving to a File, Loading from a File, File Options, File Events, FBScene - The Scene Class, FBPose - Poses, Overview of the Architecture.
FBApplication is used mainly to manage files.
It provides functionality like that in the MotionBuilder file menu, for example, open file, save file.
Note that event registration is instanced-based. When an FBApplication object is destroyed, all the event callbacks are unregistered. If you want to have a tool to be notified of events, it needs to have a FBApplication data member.
Definition at line 567 of file fbsystem.h.
#include <fbsystem.h>
Public Member Functions | |
FBApplication (HIObject pObject=NULL) | |
Constructor. | |
bool | Minimize (bool pBlocking=true) |
Minimize window. | |
bool | Maximize () |
Maximize window (minimized). | |
void | UpdateAllWidgets () |
Request to refresh display of all UI widgets. | |
void | FlushEventQueue () |
Flush event queue. | |
bool | FileNew (bool pAskUser=false, bool pClearSceneName=true) |
Command FILE->NEW in the menus. | |
bool | FileOpen (const char *pFilename, bool pShowUIMsg=false, FBFbxOptions *pOptions=NULL) |
Open a file, replacing the current scene. | |
bool | FileOpen (void *pBuffer, kULong pBufferLength) |
Open a file from memory. | |
bool | GetMaxFrameCount (void *pBuffer, kULong pBufferLength, kLong *pFrameCount, int pTimeScale) |
Get max frame count from a scene file in memory. | |
bool | FileMerge (const char *pFilename, bool pShowUIMsg=false, FBFbxOptions *pOptions=NULL) |
Merge a file with the current scene. | |
bool | FileMerge (FBStringList &pPathlist, bool pShowUIMsg=false, FBFbxOptions *pOptions=NULL) |
Merge multiple files with the current scene. | |
bool | FileAppend (const char *pFilename, bool pShowUIMsg=false, FBFbxOptions *pOptions=NULL) |
Append a file to the current scene. | |
bool | FileSave (const char *pFilename=NULL, FBFbxOptions *pOptions=NULL) |
Save the file under another name. | |
void | FileExit (bool pSave=false) |
Quit application. | |
bool | FileImport (FBString pFilename, bool pMatchModels=false, bool pCreateUnmatchedModels=true) |
Import a motion file. | |
bool | FileExport (FBString pFilename) |
Export a motion file. | |
FBBatchStatus | FileBatch (FBBatchOptions *pBatchOptions, FBPlotOptions *pPlotOptions=NULL) |
Start a batch. | |
bool | FileImportBatch (const char *pName, FBBatchOptions *pBatchOptions, FBModel *pReference) |
Import a motion file using batch options. | |
bool | FileExportBatch (const char *pName, FBTake *pTake, FBBatchOptions *pBatchOptions, FBModelList &pExportModels) |
Export a motion file using batch options. | |
bool | SaveCharacterRigAndAnimation (const char *pFileName, FBCharacter *pCharacter, FBFbxOptions *pFbxOptions) |
Save the rig and its animation in a file. | |
bool | LoadAnimationOnCharacter (const char *pFileName, FBCharacter *pCharacter, FBFbxOptions *pFbxOptions, FBPlotOptions *pPlotOptions) |
Load a rig and its animation from a file. | |
bool | IsValidBatchFile (const char *pFilename) |
Verify motion file readability. | |
bool | OneClickSendAsNewScene (FBOneClickApplication pApplication) |
Send the current scene as a new scene in the specified application. | |
bool | OneClickUpdateCurrentScene () |
Send the scene to update the current scene in the specified application. | |
bool | OneClickAddToCurrentScene () |
Send the scene and add it to the current scene in the specified application. | |
void | OneClickSelectPreviouslySentObject () |
Select, in MotionBuilder, the object that were sent. | |
FBOneClickApplication | OneClickIsConnectedTo () |
Return the other application that MotionBuilder is connected to. | |
bool | FileRender (FBVideoGrabOptions *pRenderOptions=NULL) |
Render current scene to media file. | |
bool | AudioRender (FBAudioRenderOptions *pAudioRenderOptions=NULL) |
Render audio of current scene to media file, currently WAV file only. | |
bool | ExecuteScript (FBString pFilename) |
Execute a python script file. | |
void | SwitchViewerCamera (FBCamera &pCamera) |
Switch the current viewer's camera. | |
Static Public Member Functions | |
static FBApplication & | TheOne () |
Get the global object for this class. | |
Public Attributes | |
FBPropertyEvent | OnFileNewCompleted |
Event: A File New has been completed. | |
FBPropertyEvent | OnFileNew |
Event: A File New has been requested, nothing has been destroyed yet. | |
FBPropertyEvent | OnFileOpenCompleted |
Event: A File Open has been completed. | |
FBPropertyEvent | OnFileOpen |
Event: A File Open has been requested, nothing has been loaded yet. | |
FBPropertyEvent | OnFileMerge |
Event: A File Merge has been requested, nothing has been loaded yet. | |
FBPropertyEvent | OnFileSaveCompleted |
Event: A File Save has been completed. | |
FBPropertyEvent | OnFileSave |
Event: A File Save has been requested, nothing has been saved yet. | |
FBPropertyEvent | OnFileExit |
Event: A File Exit as been requested, nothing has been destroyed yet. | |
FBPropertyString | FBXFileName |
Read Write Property: Current scene filename. | |
FBPropertyActor | CurrentActor |
Read Write Property: Indicate the current actor, as used by the character tool. | |
FBPropertyCharacter | CurrentCharacter |
Read Write Property: Indicate the current character, as used by the character tool. |
FBApplication | ( | HIObject | pObject = NULL | ) |
Constructor.
pObject | Internal parent object(default=NULL). |
bool Minimize | ( | bool | pBlocking = true | ) |
Minimize window.
pBlocking | Is the minimization blocking operation (default = true). |
bool Maximize | ( | ) |
Maximize window (minimized).
void UpdateAllWidgets | ( | ) |
Request to refresh display of all UI widgets.
void FlushEventQueue | ( | ) |
Flush event queue.
Processes all pending events for the calling thread until there are no more events to process. You can call this function occasionally when your code is busy performing a long operation (e.g. copying a file).
bool FileNew | ( | bool | pAskUser = false , |
bool | pClearSceneName = true |
||
) |
Command FILE->NEW in the menus.
pAskUser | Set to true to cause a save dialog to popup. Default is false. |
pClearSceneName | Set to true to clear the scene name, set to false to retain it. Default is true. |
bool FileOpen | ( | const char * | pFilename, |
bool | pShowUIMsg = false , |
||
FBFbxOptions * | pOptions = NULL |
||
) |
Open a file, replacing the current scene.
Command File->Open in the menus.
pFilename | File to open. |
pShowUIMsg | Set false if don't want to popup any UI dialog or messages (default=false). |
pOptions | Provide finer control on file open options (default=NULL). if not null, Option dialog will only show if both option's ShowOptionsDialog property and pShowUIMsg are true. |
bool FileOpen | ( | void * | pBuffer, |
kULong | pBufferLength | ||
) |
Open a file from memory.
pBuffer | the memory buffer for the file. Raw memory address is expected in pyfbsdk. |
pBufferLength | the memory buffer size. |
Get max frame count from a scene file in memory.
pBuffer | the memory buffer for the file. Raw memory address is expected in pyfbsdk. |
pBufferLength | the memory buffer size. |
pFrameCount | out parameter to hold max frame count. this parameter is not needed in pyfbsdk. |
pTimeScale | Time scale. |
bool FileMerge | ( | const char * | pFilename, |
bool | pShowUIMsg = false , |
||
FBFbxOptions * | pOptions = NULL |
||
) |
Merge a file with the current scene.
Command File->Merge in the menus.
pFilename | File to merge. |
pShowUIMsg | Set false if don't want to popup any UI dialog or messages (default=false). |
pOptions | Provide finer control on file open options (default=NULL). if not null, Option dialog will only show if both option's ShowOptionsDialog property and pShowUIMsg are true. |
bool FileMerge | ( | FBStringList & | pPathlist, |
bool | pShowUIMsg = false , |
||
FBFbxOptions * | pOptions = NULL |
||
) |
Merge multiple files with the current scene.
Command File->Merge in the menus.
pPathlist | Files to merge. |
pShowUIMsg | Set false if don't want to popup any UI dialog or messages (default=false). |
pOptions | Provide finer control on file open options (default=NULL). if not null, Option dialog will only show if both option's ShowOptionsDialog property and pShowUIMsg are true. |
bool FileAppend | ( | const char * | pFilename, |
bool | pShowUIMsg = false , |
||
FBFbxOptions * | pOptions = NULL |
||
) |
Append a file to the current scene.
Same as File->Merge in the menus with all options set to append. In earlier versions of MotionBuilder, a namespace could be specified with a parameter in this function, or FBFbxOptions::CustomImportNamespace, Now this is now done with FBFbxOptions::NamespaceList.
pFilename | File to merge. |
pShowUIMsg | Set false if don't want to popup any UI dialog or messages (default=false). |
pOptions | Provide finer control on file open options (default=NULL). if not null, Option dialog will only show if both option's ShowOptionsDialog property and pShowUIMsg are true. |
bool FileSave | ( | const char * | pFilename = NULL , |
FBFbxOptions * | pOptions = NULL |
||
) |
Save the file under another name.
Command File->SaveAs in the menus.
pFilename | Save file as pFilename . A value of NULL will use the current file name. |
pOptions | Provide finer control on file save options (default=NULL) |
void FileExit | ( | bool | pSave = false | ) |
Quit application.
Command File->Exit in the menus.
pSave | true if file is saved on exit(default=false). |
bool FileImport | ( | FBString | pFilename, |
bool | pMatchModels = false , |
||
bool | pCreateUnmatchedModels = true |
||
) |
Import a motion file.
Command File->Motion File Import... in the menus.
pFilename | The file to import. To import two files at the same time (ex: .amc & .asf), separate the two files path with a comma ("Path1,Path2"). |
pMatchModels | If there is already a model in the scene with the same name, the model will not be created and we replace the animation of the given model. |
pCreateUnmatchedModels | Whether unmatched models will be created. This flag matters only when pMatchModels is true. when pMatchModels is false, all the models are created. |
bool FileExport | ( | FBString | pFilename | ) |
Export a motion file.
Command File->Motion File Export... in the menus.
pFilename | The file to create. To create two files at the same time (ex: .amc & .asf), separate the two files path with a comma ("Path1,Path2"). |
FBBatchStatus FileBatch | ( | FBBatchOptions * | pBatchOptions, |
FBPlotOptions * | pPlotOptions = NULL |
||
) |
Start a batch.
Command File->Batch... in the menus.
pBatchOptions | The options for the batch process (same as in the batch UI). |
pPlotOptions | The options for plotting (same as in the plot UI)(default=NULL). |
bool FileImportBatch | ( | const char * | pName, |
FBBatchOptions * | pBatchOptions, | ||
FBModel * | pReference | ||
) |
Import a motion file using batch options.
Import used for loading files in batch process.
pName | The name of the file without extension. Extension and path will be taken from batch options. |
pBatchOptions | The options for the import. |
pReference | Reference model for the import. |
bool FileExportBatch | ( | const char * | pName, |
FBTake * | pTake, | ||
FBBatchOptions * | pBatchOptions, | ||
FBModelList & | pExportModels | ||
) |
Export a motion file using batch options.
Export used for saving files in batch process.
pName | The name of the file without extension. Extension and path will be taken from batch options. |
pTake | Animation take to the export. |
pBatchOptions | The options for the export. |
pExportModels | Models to the export. |
bool SaveCharacterRigAndAnimation | ( | const char * | pFileName, |
FBCharacter * | pCharacter, | ||
FBFbxOptions * | pFbxOptions | ||
) |
Save the rig and its animation in a file.
pFileName | File name. |
pCharacter | Character to save. |
pFbxOptions | The options for the character rig and animation export |
bool LoadAnimationOnCharacter | ( | const char * | pFileName, |
FBCharacter * | pCharacter, | ||
FBFbxOptions * | pFbxOptions, | ||
FBPlotOptions * | pPlotOptions | ||
) |
Load a rig and its animation from a file.
pFileName | File name. |
pCharacter | Target character. |
pFbxOptions | The options for the character rig and animation load |
pPlotOptions | If the animation should be plotted on the target rig, these plot options will be used. Set to NULL if animation will not be plotted. |
bool IsValidBatchFile | ( | const char * | pFilename | ) |
Verify motion file readability.
pFilename | The file to test. |
bool OneClickSendAsNewScene | ( | FBOneClickApplication | pApplication | ) |
Send the current scene as a new scene in the specified application.
pApplication | The application that will receive the scene. |
bool OneClickUpdateCurrentScene | ( | ) |
Send the scene to update the current scene in the specified application.
bool OneClickAddToCurrentScene | ( | ) |
Send the scene and add it to the current scene in the specified application.
void OneClickSelectPreviouslySentObject | ( | ) |
Select, in MotionBuilder, the object that were sent.
FBOneClickApplication OneClickIsConnectedTo | ( | ) |
Return the other application that MotionBuilder is connected to.
bool FileRender | ( | FBVideoGrabOptions * | pRenderOptions = NULL | ) |
Render current scene to media file.
Command FILE->RENDER in the menus.
pRenderOptions | The options used when rendering the scene. If you don't specify them, current one are used. |
bool AudioRender | ( | FBAudioRenderOptions * | pAudioRenderOptions = NULL | ) |
Render audio of current scene to media file, currently WAV file only.
pAudioRenderOptions | The options used when rendering audio of the scene. Default value: 2 channels, 16 bits, 44100 hz, the begin and end time span for current time referential, Default file name is "Output.wav" in the last audio output path, ro the default document path if the last path doesn't exist. |
bool ExecuteScript | ( | FBString | pFilename | ) |
Execute a python script file.
pFilename | The script file to execute. |
void SwitchViewerCamera | ( | FBCamera & | pCamera | ) |
Switch the current viewer's camera.
pCamera | Camera to switch current viewer to. |
static FBApplication& TheOne | ( | ) | [static] |
Event: A File New has been completed.
Definition at line 576 of file fbsystem.h.
Event: A File New has been requested, nothing has been destroyed yet.
Definition at line 577 of file fbsystem.h.
Event: A File Open has been completed.
Definition at line 578 of file fbsystem.h.
Event: A File Open has been requested, nothing has been loaded yet.
Definition at line 579 of file fbsystem.h.
Event: A File Merge has been requested, nothing has been loaded yet.
Definition at line 580 of file fbsystem.h.
Event: A File Save has been completed.
Definition at line 581 of file fbsystem.h.
Event: A File Save has been requested, nothing has been saved yet.
Definition at line 582 of file fbsystem.h.
Event: A File Exit as been requested, nothing has been destroyed yet.
Definition at line 583 of file fbsystem.h.
Read Write Property: Current scene filename.
Definition at line 829 of file fbsystem.h.
FBPropertyActor CurrentActor |
Read Write Property: Indicate the current actor, as used by the character tool.
Can be NULL. If not null, CurrentCharacter must be null, as the character tool works on only one item at a time.
Definition at line 831 of file fbsystem.h.
FBPropertyCharacter CurrentCharacter |
Read Write Property: Indicate the current character, as used by the character tool.
Can be NULL. If not null, CurrentActor must be null, as the character tool works on only one item at a time.
Definition at line 834 of file fbsystem.h.