API Reference

Configuration

class Configuration

Bases: object

buildScriptVar = 'HIVE_BUILD_SCRIPTS_PATH'
namingVar = 'HIVE_NAMING_PATH'
exportPluginVar = 'HIVE_EXPORT_PLUGIN_PATH'
containerType()

Default container type, can be asset, set or None.

Returns

The container Type

Return type

str

serialize()
updateConfigurationFromRig(rig)

Updates the current configuration from the given scene rig instance.

Parameters

rig (zoo.libs.hive.base.rig.Rig) – The rig instance to pull the configuration from.

Returns

The rig configuration dict pull from the scene rig.

Return type

dict

applySettingsState(state, rig=None)
setNamingPresetByName(name)

Sets the current Naming convention preset.

Parameters

name (str) – The Preset Name.

findNamingConfigForType(hiveType, presetName=None)

Finds and returns the naming convention config for the hive Type.

The Hive Type is one of three keys either “rig”, “global” or the component Type.

Parameters
  • hiveType (str) – The Hive Type to search for, ie. componentType, “rig” or “global”

  • presetName (str or None) – The Preset to use to find the component Type

Returns

The naming configuration Manager instance

Return type

zoo.libs.naming.naming.NameManager

setBuildScripts(scriptIds)

Overrides the current build scripts applied to this configuration.

Parameters

scriptIds (list[str]) – A list of build script plugin ids

addBuildScript(scriptId)

Adds/appends the build script plugin given the id.

Parameters

scriptId (str) – The build script plugin id.

Returns

Whether the build script was added to the configuration.

Return type

bool

buildScriptConfig(rig)
static updateBuildScriptConfig(rig, config)
static setBuildScriptConfig(rig, config)

Sets the build script configuration on the provided rig.

Note

Must be json compatible.

The configData is in the following form.

{
    "buildScriptId": {"propertyName": "propertyValue"}
}
Parameters
removeBuildScript(scriptId)

Removes the build script from this rig configuration.

Note

This will not remove any script specified in userPreferences which act as the default for all rigs.

Parameters

scriptId (str) – The script Id for the buildScript instance to remove

Returns

True if removed

Return type

bool

exportPluginForId(pluginId)

Retrieves the exporter plugin class callable by ID.

If the plugin id has been overridden in the hive preferences then use that ID instead.

Parameters

pluginId (str) – The hive exporter plugin id.

Returns

The plugin id which matches the request.

Return type

callable[zoo.libs.hive.base.exporterplugin.ExporterPlugin] or None

componentRegistryObject(componentType)
Parameters

componentType (str) – the component type string

Returns

Return type

zoo.libs.hive.base.component.Component

loadComponentDefinition(componentType)
initComponentDefinition(componentType)
templatePaths()

Returns all current Registered search paths for Templates.

Return type

list[str]

componentPaths()

Returns all current Registered search paths for Components.

Return type

list[str]

definitionPaths()

Returns all folder search paths registered for the definition files.

Return type

list[str]

static buildScriptPaths()

Returns all current build script paths from the environment variable as a list.

Return type

list[str]

static controlShapeNames()

Returns all the control shape names from the shape library.

Return type

list(str)

classmethod componentRegistry()

Returns the current component registry instance.

Return type

registry.ComponentRegistry

classmethod templateRegistry()

Returns the current template registry instance.

Return type

registry.TemplateRegistry

classmethod buildScriptRegistry()

Returns the current build script registry instance.

Return type

pluginmanager.PluginManager

classmethod exporterPluginRegistry()

Returns the current build script registry instance.

Return type

pluginmanager.PluginManager

classmethod namePresetRegistry()
Returns

Return type

:class:` namingpresets.PresetManager`

reload(reloadPlugins=False)
initializeComponentRegistry(reload=False)
initializeTemplateRegistry(reload=False)
initializeBuildScriptRegistry(preferenceInterface, reload=False)
initializeExporterRegistry(preferenceInterface, reload=False)
initializeNamingPresetManager(preferencesInterface, reload=False)

Registry

class ComponentRegistry(*args, **kwargs)

Bases: object

This class manages and stores a collection of component objects from the component library, this class is a singleton and is responsible for returning the create component objects and definitions.

refresh()

Refreshes the library by clearing the registry then rediscovering the component plugins

initComponentDefinition(name)

Creates and returns a new ComponentDefinition instance based on the name parameter

Parameters

name (str) – the componentType

Return type

baseDefinition.ComponentDefinition or None

fromMetaNode(rig, metaNode)
findComponentByType(name)

Find and return the component class object from the registry.

Parameters

name (str) – the component name, currently the class name

Returns

callable[zoo.libs.hive.base.component.Component]

loadComponentDefinition(componentName)

Loads the definition file for the component in the registry using json.

Parameters

componentName (str) – the component name currently the class name

Returns

the definition dict

Return type

dict

saveComponentDefinition(definition)

Saves the definition object by overwrite the existing one.

Parameters

definition (Definition) – The definition object to save.

Return type

bool

componentData(name)

returns the registry component dict

Parameters

name (str) – the component type to get

Returns

{“object”: object(), “path”: str, “definition”: str } # the definition name :rtype: dict

discoverComponents()

Searches the component library specfied by the environment variable “ZOO_HIVE_COMPONENT_PATH”

class TemplateRegistry(*args, **kwargs)

Bases: object

Class to handle hive templates, templates are the serialized form of a rig.

property templates
refresh()

Refreshes the library by clearing the registry then rediscovering the component plugins

saveLocation()
saveTemplate(name, template, templateRootPath=None, overwrite=False)
saveComponentsAsTemplate(rig, components, name, templateRootPath, overwrite)
renameTemplate(name, newName)
deleteTemplate(name)
hasTemplate(name)

Checks whether the registry contains the template with the name.

Parameters

name (str) – The template name to check.

Returns

Returns True if the template exists in the registry.

Return type

bool

template(name)

Returns the rig template dict from the registry

Parameters

name (str) – the template name

Returns

The loaded template dict

Return type

dict

templatePath(name)
Parameters

name (str) –

Returns

Return type

str

addTemplate(path)
discoverTemplates()

Errors

exception HiveError(msg='', *args, **kwargs)

Bases: Exception

msg = ''
exception HiveRigDuplicateRigsError(dupes, *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = 'Duplicate rigs in the scene, please use namespace filtering: {}'
exception ComponentDoesntExistError(msg='', *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = "Component doesn't exist in the scene: "
exception ComponentGroupAlreadyExists(msg='', *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = 'Component group already exists for this rig instance'
exception TemplateAlreadyExistsError(msg='', *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = 'Template path: {} already exists!'
exception TemplateMissingComponents(msg='', *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = 'No Components specified in template: {}'
exception TemplateRootPathDoesntExist(msg='', *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = "Template root path doesn't exist on disk: {}"
exception InvalidInputNodeMetaData(msg='', *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = 'InputLayer meta data is missing inputNode connection'
exception InvalidOutputNodeMetaData(msg='', *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = 'OutputLayer meta data is missing outputNode connection'
exception InitializeComponentError(componentName, *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = 'Failed to initialize component: {}'
exception MissingRootTransform(metaName, *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = 'Missing Root transform on meta node: {}'
exception RootNamespaceActiveError(msg='', *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = 'Current namespace is already the root'
exception BuildComponentGuideUnknownError(msg='', *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = 'Unknown build guide error'
exception BuildComponentDeformUnknownError

Bases: Exception

msg = 'Unknown build Deform error'
exception BuildComponentRigUnknownError(msg='', *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = 'Unknown build Rig error'
exception BuildError(msg='', *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

exception MissingRigForNode(msg='', *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = 'Node is not attached to a rig'
exception MissingMetaNode(msg='', *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = 'Attached meta node is not a valid hive node'
exception MissingComponentType(componentName, *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = 'Missing component of type: {}, from the hive component registry'
exception ComponentNameError(componentName, *args, **kwargs)

Bases: NameError

msg = 'Component by the name: {}, already exists!'
exception MissingJoint(jointId, *args, **kwargs)

Bases: NameError

msg = 'Missing Joint by id : {}'
exception MissingControlError(msg='', *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = 'Missing Control by id : {}'
exception UnSupportedConnectableNode(msg='', *args, **kwargs)

Bases: zoo.libs.hive.base.errors.HiveError

msg = "Attempting to connect to unsupported guide: '{}'"
exception InvalidDefinitionAttrExpression

Bases: Exception

exception InvalidDefinitionAttrForSceneNode

Bases: Exception