HarmonyModule Class Reference

Detailed Description

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]

from ToonBoom import harmony #Import the Harmony Module
current_session = harmony.session() #Fetch the currently active session of Harmony

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(""))
 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::Harmonysession ()
 Provides the session for Harmony and its active object. More...
 
void close_project ()
 Closes the currently loaded project.. More...
 

Member Function Documentation

◆ close_project()

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.

from ToonBoom import harmony #Import the Harmony Module
harmony.open_project( "path/to/project/file.xstage ) #Open the Harmony scene file offline.
harmony.close_project() #Closes the project as above.

◆ launch()

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.

Note
When using open_project, or open_project_database – an instance of Harmony will be launched if no other instance is available

◆ open_project()

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.

Parameters
projectPath- The path to the project file, including the filename and .xstage.
from ToonBoom import harmony #Import the Harmony Module
harmony.open_project( "path/to/project/file.xstage ) #Open the Harmony scene file offline.

◆ open_project_database()

void HarmonyModule::open_project_database ( QString  userName,
QString  envName,
QString  jobName,
QString  sceneName,
QString  versionName = QString("") 
)

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.

Parameters
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.
from ToonBoom import harmony #Import the Harmony Module
harmony.open_project_database( "usabatch", "environment", "job", "scene" ) #Open the Harmony scene file online, with the Harmony server's database..

◆ session()

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.

Returns
OMH::Harmony* The harmony session object that provides further access to the application and its contents.
from ToonBoom import harmony #Import the Harmony Module
session = harmony.session()