The root object that provides initialization and access to the Harmony session.
The Harmony module is provided when importing it from the ToonBoom library in Python.
When imported into Python, the Harmony Module is the initial object available and it provides subsequent access to other Harmony classes onces initialized.
Harmony's Python Console [Internal]
Public Member Functions | |
void | launch () |
Launches the instance of Harmony if none is available. Launching an instance of harmony allows access to specific Harmony global objects, further access to a scene will require a project to be opened. More... | |
void | open_project_database (QString userName, QString envName, QString jobName, QString sceneName, QString versionName=QString(""), bool readOnly=false) |
Opens a project over the Harmony database given the current database configuration. More... | |
void | open_project (QString projectPath) |
Opens an offline Harmony project. More... | |
OMH::Harmony * | session () |
Provides the session for Harmony and its active object. More... | |
void | close_project () |
Closes the currently loaded project.. More... | |
void HarmonyModule::close_project | ( | ) |
Closes the currently loaded project..
Closing the project from an internal Python console will result in the project being closed similar to using the menu option File -> Close .
Closing the project from an external Python console will result in the active project being closed, and the session no longer having a project available. A subsequent project will need to be loaded for further actions in the interpreter.
void HarmonyModule::launch | ( | ) |
Launches the instance of Harmony if none is available. Launching an instance of harmony allows access to specific Harmony global objects, further access to a scene will require a project to be opened.
void HarmonyModule::open_project | ( | QString | projectPath | ) |
Opens an offline Harmony project.
Open the scene located at the given path. If a scene is previously opened, it will be closed first. Unsaved changes will be lost. Opening an offline project requires a Harmony Database license, but will open an offline Harmony stage file.
projectPath | - The path to the project file, including the filename and .xstage. |
void HarmonyModule::open_project_database | ( | QString | userName, |
QString | envName, | ||
QString | jobName, | ||
QString | sceneName, | ||
QString | versionName = QString("") , |
||
bool | readOnly = false |
||
) |
Opens a project over the Harmony database given the current database configuration.
Opening a project over the Harmony Database requires a database configuration and appropriate database licenses. The project will be opened with the provided arguments.
userName | - The username to use while loading the project over the database. This username should be a valid user name in the database. |
envName | - The environment in which the project resides. |
jobName | - The job in which the project resides. |
sceneName | - The name of the scene that should be loaded. |
versionName | - Optional. The named version to load. If none is provided, the current version of the scene is loaded. |
readOnly | - Optional. When true, the scene will be opened as read-only and no lock will be taken from the database. |
OMH::Harmony* HarmonyModule::session | ( | ) |
Provides the session for Harmony and its active object.
This is the main access to the application, the project and its contents.
The session is loaded when the application is launched and a project is opened. When internal to Harmony, the session will be the actively loaded project in Harmony. When offline, the session will be the project that has been loaded from the subsequent open_project and open_project_database commands.