Application Messages

Action Messages

  • APPLICATION_CLOSE_SCENE - Closes the current scene and calls SHUTDOWN if a Shutdown was initiated. This message is broadcastable. This message will trigger the following response messages: DOCUMENT_CLOSED. This default maximum wait time for this message is 50.

  • APPLICATION_EXPORT_SCENE - Exports the scene to the given file. Currently, FBX is the only export file-format supported. This message will trigger the following response messages: APPLICATION_SCENE_EXPORTED. This default maximum wait time for this message is 200.

    Parameters:

    • filename (unicode) - The filename to be used for export.

    • features (tuple) - A tuple of the ids of features to be exported: 'LIGHT_ASSIGNMENTS' - LightAssignmentIO.id, 'MODELS' - ModelIO.id, 'MODELIMPORT' - ModelImportIO.id, 'MATERIALS' - MaterialIO.id, 'MATERIAL_ASSIGNMENTS' - MaterialAssignmentIO.id, 'SHADOW' - ShadowIO.id, 'OBJECT_PROPERTIES' - ObjectPropertiesIO.id, 'TRANSLATIONS' - TranslationIO.id

    • options (int) - A bitfield (integer) representing the export options: 1 - kConvertToYUp, 2 - kExportHidden, 4 - kExportAllLODs, 8 - kExportAsAscii, 16 - kExportPatches, 32 - kExportEmptyGroups, 64 - kExportSplineData, 128 - kExportAlternatives, 256 - kExportMayaCompatible, 512 - kMergeCombinedToSingleNode, 1024 - kExportIncludeAllMaterialTextures, 2048 - kUseNodeLabelsAsIds, 4096 - kExportIncludeOnlySelected, 8192 - kExportPreserveAllPatchData, 16384 - kExportEmptyMeshes

  • APPLICATION_IMPORT_SCENE - Loads the specified scene from file into the current document. If feature IDs are specified in the feature list, then only those features will be imported from the file. To import materials, one would specify MaterialIO.id in the features. To import models only, one would use ModelIO.id, ModelImportIO.id, ShadowIO.id, ObjectsPropertiesIO.id. If both models and materials are required, the combined list would be specified, together with MaterialAssignmentIO.id. Additionally, you can independently specify SelectionSetIO.id, AlternativeIO.id and ShotIO.id to get those features imported. An empty feature list is replaced by a default list that is equivalent to importing models with materials and their corresponding assignments. This message is broadcastable. This default maximum wait time for this message is 100.

    Parameters:

    • filename (unicode) - The name of the scene file to be imported.

    • features (tuple) - A tuple of those feature IDs to be imported from the scene file (See APPLICATION_EXPORT_SCENE).

  • APPLICATION_LOAD_SCENE - Loads the specified scene from file. This message is broadcastable. This message will trigger the following response messages: MODEL_IMPORT_DISPLAYED_ALL. This default maximum wait time for this message is 200.

    Parameters:

    • filename (unicode) - The name of the file to be loaded.

  • APPLICATION_LOAD_SCENE_FROM_INSTALLED - Loads the specified scene from /support/SampleScenes/ in program installation directory. This message is broadcastable.

    Parameters:

    • filename (unicode) - The name of the file to be loaded, without directory.

  • APPLICATION_LOAD_SCENE_SAFE - Loads the specified scene from file after asking if the user wants to save previous scene or not. This message is broadcastable.

    Parameters:

    • filename (unicode) - The name of the file to be loaded.

  • APPLICATION_NEW_SCENE - Creates a new scene. ** NOTE ** This should never be called explicitly. APPLICATION_REQUEST_NEW_SCENE should be called instead, as it will ensure proper scene teardown This message is broadcastable. This message will trigger the following response messages: MODEL_IMPORT_DISPLAYED_ALL. This default maximum wait time for this message is 50.

  • APPLICATION_PROCESS_DROP - Opens the scene or models that were dropped on the application window, if possible.

    Parameters:

    • filenames (list) - The names of the dropped files.

  • APPLICATION_REMOVE_FILE - Removes the specified file. There is no undo available for this operation, and the file is not moved to a Recycle Bin.

    Parameters:

    • filename (unicode) - The name of the file to remove (full or relative path).

  • APPLICATION_REQUEST_QUIT - Prompts the user to save before quitting if a scene is open.

  • APPLICATION_SAVE_FILE - Saves text to the specified file. No processing of the text string will be done, it will just save the data as given. This file is of no particular type or significance. This is just a utility function.

    Parameters:

    • filename (unicode) - The name of the file (full or relative path).

    • text (unicode) - The actual text to write.

    • mode (unicode) - Append to the existing file (a) or create/(over)write a new one (w).

  • APPLICATION_SAVE_PREFERENCES - Saves the current user preferences.

  • APPLICATION_SAVE_SCENE - Writes the currently open scene to the given filename in .xml format. This message will trigger the following response messages: APPLICATION_SCENE_SAVED. This default maximum wait time for this message is 50.

    Parameters:

    • filename (unicode) - The filename for saving the current document.

  • APPLICATION_SAVE_SCENE_WITH_TEXTURES - Writes the currently open scene to the given filename in .xml format, and copies all textures to the companion directory.

    Parameters:

    • filename (unicode) - The filename for saving the current document.

  • APPLICATION_SET_INTERACTION_MODE - Send this message when any action occurs that may affect the interaction mode of the application. Typical actions that may affect the interaction mode are pressing modifier keys, selecting an application mode, or pressing mouse buttons. This message will trigger the following response messages: APPLICATION_INTERACTION_MODE_CHANGED. This default maximum wait time for this message is 10.

    Parameters:

    • interactionMode (unicode) - The interaction mode affected. (See "Class InteractionMode" in the Showcase API Reference documentation.)

    • active (bool) - True to indicate that the mode is active, False to indicate that it is inactive.

  • APPLICATION_SET_MODE - Switches the application mode.

    Parameters:

    • mode (unicode) - The application mode: 'Authoring' or 'Viewing'. (See "Class ApplicationModeName" in the Showcase API Reference documentation.)

  • APPLICATION_SET_UNITS - Set new global units. The new units will be saved to user prefs.

    Parameters:

    • units (unicode) - A name of new units.

    • precision (unicode) - A string representing a precision factor

  • APPLICATION_UPDATE_PREFERENCES - Updates user preferences. All preference interpreters should update data to the latest state if they have not done so before.

  • BROWSER_NAVIGATE_URL - If the browser is open, navigates to the given URL.

    Parameters:

    • url (unicode) - A valid URL to navigate the browser to.

  • QUIT - Initiates a shutdown and queues APPLICATION_CLOSE_SCENE.

  • REDO - Redoes the last redoable message.

  • SET_DOCUMENT - Sets a new document, updates heads up display, and initializes document data everywhere.

    Parameters:

    • document ('Document.Document) - The new document being set.

  • SHUTDOWN - Stops running the event/message queue once it is processed. No further event processing takes place. Any interpreters receiving this message can assume that no further messages will be received.

  • STARTUP - Initializes the Showcase user interface.

  • UNDO - Undoes the last undoable message.

  • UNDO_DUMP_QUEUE - Prints the size (total number of undo's and redo's) and content of undo and redo queues.

  • UNDO_FLUSH_QUEUE - Clears the undo and redo queues.

  • DOCUMENT_UNITS_CHANGED - Information message that the scene units have changed.

    Parameters:

    • units (unicode) - A name of new units.

    • precision (unicode) - A string representing a precision factor

  • APPLICATION_REQUEST_PATH - Requests a path to the application.

    Parameters:

    • pathID (unicode) - The application path identifier. Valid pathIDs are: 'Materials', 'WorkingDirectory'.

  • DOCUMENT_REQUEST_INFO - Requests a document file name.

Information Messages

  • APPLICATION_COMPACT_SCENE_SAVED - Indicates that the current scene was successfully compact saved.

    Parameters:

    • Filename (unicode) - The full pathname of the newly saved scene.

    • companionDir (unicode) - The full pathname of the newly saved scenes companion dir, need not be the same as the current companion dir.

  • APPLICATION_IMPORT_SCENE_FAILED - Indicates that a scene file failed to import. A failure is usually due to a scene file that was not found, or a syntax error within the scene file.

    Parameters:

    • filename (unicode) - The name of the scene file to be imported.

    • features (tuple) - A tuple of those feature IDs to be imported from the scene file (See APPLICATION_EXPORT_SCENE).

  • APPLICATION_INTERACTION_MODE_CHANGED - Indicates that the interaction mode of the application changed. Listen to this message to know the current interaction mode of the application.

    Parameters:

    • interactionMode (unicode) - The current interaction mode of the application.

  • APPLICATION_LOAD_SCENE_IMPORTS_COMPLETE - Indicates that all of the files to be imported as part of a load scene have been imported.

  • APPLICATION_MODE_CHANGED - Indicates that the application mode has changed. This message is a response to the APPLICATION_SET_MODE message.

  • APPLICATION_PATH - Indicates the path to the application. Response to APPLICATION_REQUEST_PATH.

    Parameters:

    • pathID (unicode) - The application path identifier.

    • path (unicode) - The path to the application.

  • APPLICATION_SAVE_SCENE_FAILED - Indicates that the current scene was not successfully saved.

    Parameters:

    • filename (unicode) - The full pathname of the scene.

    • reason (unicode) - The reason that the scene was not successfully saved.

  • APPLICATION_UNITS_CHANGED - Information message that the units have changed.

    Parameters:

    • units (unicode) - A name of new units.

    • precision (unicode) - A string representing a precision factor

  • DIAGNOSTIC_MODE_CHANGED - Indicates that the diagnostic mode changed.

    Parameters:

    • mode (int) - The diagnostic mode value. The value is 0 when not in a diagnostic mode. Any value other than 0 means a diagnostic mode is active.

  • UNDO_QUEUE_CHANGED - Indicates that an undoable action was added to the undo queue or removed from it.

    Parameters:

    • undoQueueLength (int) - The current length of the undo queue.

    • redoQueueLength (int) - The current length of the redo queue.

  • DOCUMENT_INFO - Indicates the document's filename and status specifying if the document was modified since last saved.

    Parameters:

    • documentFilename (unicode) - The path to the document.

    • needsSaving (bool) - True if the file was modified since last saved.

  • DOCUMENT_LOAD_FAILED - Indicates that a document failed to load into the application.

    Parameters:

    • document ('Document.Document) - The document object that failed to load.

  • DOCUMENT_LOADED - Indicates that a new document was loaded into the application. In the case of archived files (e.g., .zip) it would be the name of the archive, not the name of the extracted scene files that is specified.

    Parameters:

    • Filename (unicode) - The full pathname of the newly loaded document.

  • DOCUMENT_SET_UNITS - Set scene units. The new units will be saved with the scene. This message is undoable and broadcastable.

    Parameters:

    • units (unicode) - A name of the units.

    • precision (unicode) - A string representing a precision factor

Response Messages

  • APPLICATION_SCENE_EXPORTED - Indicates that a scene was successfully exported.

    Parameters:

    • filename (unicode) - The name of the exported file.

    • features (tuple) - A tuple of the ids of exported features (See APPLICATION_EXPORT_SCENE).

    • options (int) - A bitfield (integer) representing the export options (See APPLICATION_EXPORT_SCENE).

  • APPLICATION_SCENE_IMPORTED - Indicates that a scene was successfully imported.

    Parameters:

    • filename (unicode) - The name of the scene file that was imported.

    • features (tuple) - A tuple of those feature IDs that were imported from the scene file (See APPLICATION_EXPORT_SCENE).

  • APPLICATION_SCENE_SAVED - Indicates that the current scene was successfully saved.

    Parameters:

    • Filename (unicode) - The full pathname of the newly saved scene.

  • DOCUMENT_CLOSED - Indicates that a document was closed.