start_version_control
¶
Module Contents¶
Classes¶
Simple plugin to insert a version number into the houdini file path if one |
Functions¶
Simple helper for returning a log action dict for saving the session |
|
Simple helper for returning a log action to show version docs |
|
|
Save the current session to the supplied path. |
Return the path to the current session |
-
class
HoudiniStartVersionControlPlugin
[source]¶ Bases:
HookBaseClass
Simple plugin to insert a version number into the houdini file path if one does not exist.
-
_get_version_number
(self, path, item)[source]¶ Try to extract and return a version number for the supplied path.
- Parameters
path – The path to the current session
- Returns
The version number as an int if it can be determined, else None.
NOTE: This method will use the work template provided by the session collector, if configured, to determine the version number. If not configured, the version number will be extracted using the zero config path_info hook.
-
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.
-