Zoo tools Host Engine¶
- class HostApplication(name, version, versionYear)¶
Bases:
object
Simple class for containing the current Host application information. Meant to be derived for the Host specifically.
- Parameters:
- property executable¶
The executable path of the host application.
- Returns:
The executable path.
- Return type:
- property installLocation¶
The installation location of the host application.
- Returns:
The installation location.
- Return type:
- property isHeadless¶
Checks if the host application is running in headless mode.
- Returns:
True if headless, False otherwise.
- Return type:
- property qtMainWindow¶
Returns the main window of the host application.
- Returns:
The main window.
- Return type:
QMainWindow
- class Engine(configuration, engineName)¶
Bases:
object
Base class for a host engine.
When a DCC integration is created it should derive from this base class and reimplement the required methods. It’s designed to load zootools in a DCC specific way, loading menus, shelf, callback management, launching dialogs (docking, etc.), retrieve host information (version). The usersetup.py (maya, houdini), blender addon, maya plugin would create the specific engine by name.
- Parameters:
configuration (Configuration) – The configuration object.
engineName (str) – The name of the engine.
- init()¶
Initializes the engine. Called immediately after the engine is created.
- property initialized¶
Checks if the engine has been initialized.
- Returns:
True if initialized, False otherwise.
- Return type:
- property host¶
Returns the current host application information.
- Returns:
The host application information.
- Return type:
- postInit()¶
Post-initialization method. called after the engine has been created but before any packages have been setup.
- preEnvInit()¶
Before any packages have been set up but after postInit.
Implemented by derived class
- postEnvInit()¶
After all packages and package command scripts have been initialized.
Implemented by derived class
- shutdownEngine()¶
Shuts down the engine.
Implemented by derived class
- showDialog(windowCls, name='', show=True, allowsMultiple=False, *clsArgs, **clsKwargs)¶
Shows a dialog window.
- Parameters:
windowCls (type) – The class of the dialog window.
name (str) – The name of the dialog.
show (bool) – Flag indicating whether to show the dialog.
allowsMultiple (bool) – Flag indicating whether multiple instances of the dialog are allowed.
clsArgs (tuple) – Additional arguments to pass to the dialog class constructor.
clsKwargs (dict) – Additional keyword arguments to pass to the dialog class constructor.
- closeDialog(name, widget)¶
Closes a dialog window.
- Parameters:
name (str) – The name of the dialog.
widget (QWidget) – The widget of the dialog to close.
- closeAllDialogs()¶
Closes all registered dialog windows.
- registerDialog(name, dialog)¶
Registers a dialog window.
- Parameters:
name (str) – The name of the dialog.
dialog (QWidget) – The dialog window to register.
- unregisterDialog(name, dialog)¶
Unregisters a dialog window.
- Parameters:
name (str) – The name of the dialog.
dialog (QWidget) – The dialog window to unregister.
- setCurrentEngine(engine)¶
Sets the current engine.
- Parameters:
engine (Engine) – The engine to set as current.
- startEngine(config, engineCls, engineName)¶
Starts the engine.
- Parameters:
config (Configuration) – The configuration object.
engineCls (type) – The engine class.
engineName (str) – The name of the engine.
- Returns:
The initialized engine.
- Return type:
- shutdownEngine()¶
Shuts down the current engine.