publish_session

Module Contents

Classes

HoudiniSessionPublishPlugin

Plugin for publishing an open houdini session.

Functions

_get_save_as_action()

Simple helper for returning a log action dict for saving the session

_save_session(path)

Save the current session to the supplied path.

_session_path()

Return the path to the current session

HookBaseClass[source]
class HoudiniSessionPublishPlugin[source]

Bases: HookBaseClass

Plugin for publishing an open houdini session.

This hook relies on functionality found in the base file publisher hook in the publish2 app and should inherit from it in the configuration. The hook setting for this plugin should look something like this:

hook: "{self}/publish_file.py:{engine}/tk-multi-publish2/basic/publish_session.py"
accept(self, settings, item)[source]

Method called by the publisher to determine if an item is of any interest to this plugin. Only items matching the filters defined via the item_filters property will be presented to this method.

A publish task will be generated for each item accepted here. Returns a dictionary with the following booleans:

  • accepted: Indicates if the plugin is interested in this value at

    all. Required.

  • enabled: If True, the plugin will be enabled in the UI, otherwise

    it will be disabled. Optional, True by default.

  • visible: If True, the plugin will be visible in the UI, otherwise

    it will be hidden. Optional, True by default.

  • checked: If True, the plugin will be checked in the UI, otherwise

    it will be unchecked. Optional, True by default.

Parameters
  • settings – Dictionary of Settings. The keys are strings, matching the keys returned in the settings property. The values are Setting instances.

  • item – Item to process

Returns

dictionary with boolean keys accepted, required and enabled

property description(self)[source]

Verbose, multi-line description of what the plugin does. This can contain simple html for formatting.

finalize(self, settings, item)[source]

Execute the finalization pass. This pass executes once all the publish tasks have completed, and can for example be used to version up files.

Parameters
  • settings – Dictionary of Settings. The keys are strings, matching the keys returned in the settings property. The values are Setting instances.

  • item – Item to process

property item_filters(self)[source]

List of item types that this plugin is interested in.

Only items matching entries in this list will be presented to the accept() method. Strings can contain glob patters such as , for example [“maya.”, “file.maya”]

publish(self, settings, item)[source]

Executes the publish logic for the given item and settings.

Parameters
  • settings – Dictionary of Settings. The keys are strings, matching the keys returned in the settings property. The values are Setting instances.

  • item – Item to process

property settings(self)[source]

Dictionary defining the settings that this plugin expects to receive through the settings parameter in the accept, validate, publish and finalize methods.

A dictionary on the following form:

{
    "Settings Name": {
        "type": "settings_type",
        "default": "default_value",
        "description": "One line description of the setting"
}

The type string should be one of the data types that toolkit accepts as part of its environment configuration.

validate(self, settings, item)[source]

Validates the given item to check that it is ok to publish. Returns a boolean to indicate validity.

Parameters
  • settings – Dictionary of Settings. The keys are strings, matching the keys returned in the settings property. The values are Setting instances.

  • item – Item to process

Returns

True if item is valid, False otherwise.

_get_save_as_action()[source]

Simple helper for returning a log action dict for saving the session

_save_session(path)[source]

Save the current session to the supplied path.

_session_path()[source]

Return the path to the current session :return: