API Reference¶
- Rig
Rig
Rig.hiveVersion
Rig.meta
Rig.blackBox
Rig.iterComponents()
Rig.startSession()
Rig.rootTransform()
Rig.exists()
Rig.name()
Rig.rename()
Rig.namingConfiguration()
Rig.buildState()
Rig.isLiveLink()
Rig.setLiveLink()
Rig.createGroup()
Rig.addToGroup()
Rig.removeGroup()
Rig.removeFromGroup()
Rig.renameGroup()
Rig.groupNames()
Rig.iterComponentsForGroup()
Rig.createComponent()
Rig.clearComponentCache()
Rig.buildGuides()
Rig.setGuideVisibility()
Rig.buildDeform()
Rig.buildRigs()
Rig.polish()
Rig.controlDisplayLayer()
Rig.deleteGuides()
Rig.deleteDeform()
Rig.deleteRigs()
Rig.deleteComponents()
Rig.deleteComponent()
Rig.deleteControlDisplayLayer()
Rig.delete()
Rig.duplicateComponent()
Rig.duplicateComponents()
Rig.mirrorComponent()
Rig.mirrorComponents()
Rig.components()
Rig.rootComponents()
Rig.hasComponent()
Rig.component()
Rig.componentsByType()
Rig.componentFromNode()
Rig.serializeFromScene()
Rig.saveConfiguration()
Rig.cachedConfiguration()
Rig.componentLayer()
Rig.deformLayer()
Rig.geometryLayer()
Rig.selectionSets()
Rig.getOrCreateGeometryLayer()
Rig.getOrCreateDeformLayer()
Rig.getOrCreateComponentLayer()
Rig.buildScriptContext()
alignGuides()
rootByRigName()
iterSceneRigMeta()
iterSceneRigs()
loadFromTemplateFile()
loadFromTemplate()
rigFromNode()
parentRig()
componentFromNode()
componentMetaNodeFromNode()
componentsFromSelected()
componentsFromNodes()
- Component
Component
Component.creator
Component.definitionName
Component.icon
Component.documentation
Component.betaVersion
Component.isBuildingGuide
Component.isBuildingRig
Component.isBuildingSkeleton
Component.applicationVersion
Component.logger
Component.meta
Component.componentType
Component.isBetaVersion
Component.definition
Component.saveDefinition()
Component.rig
Component.blackBox
Component.namingConfiguration()
Component.currentNamingPreset()
Component.container()
Component.isHidden()
Component.hide()
Component.show()
Component.createContainer()
Component.deleteContainer()
Component.hasContainer()
Component.create()
Component.rootTransform()
Component.group()
Component.setMetaNode()
Component.exists()
Component.serializedTokenKey()
Component.name()
Component.side()
Component.setSide()
Component.rename()
Component.updateNaming()
Component.setGuideNaming()
Component.setDeformNaming()
Component.uuid()
Component.renameNamespace()
Component.namespace()
Component.parentNamespace()
Component.removeNamespace()
Component.hasGuide()
Component.hasRig()
Component.hasSkeleton()
Component.hasPolished()
Component.parent()
Component.hasParent()
Component.children()
Component.setParent()
Component.removeParent()
Component.removeAllParents()
Component.disconnectAllChildren()
Component.disconnect()
Component.disconnectAll()
Component.disconnectComponentContext()
Component.removeUpstreamAnnotations()
Component.inputLayer()
Component.outputLayer()
Component.deformLayer()
Component.rigLayer()
Component.geometryLayer()
Component.guideLayer()
Component.findLayer()
Component.controlPanel()
Component.duplicate()
Component.mirror()
Component.pin()
Component.unPin()
Component.serializeFromScene()
Component.nodes()
Component.componentParentGuide()
Component.componentParentJoint()
Component.spaceSwitchUIData()
Component.subsystems()
Component.createSubSystems()
Component.buildGuide()
Component.buildDeform()
Component.buildRig()
Component.idMapping()
Component.preSetupGuide()
Component.updateGuideSettings()
Component.setupGuide()
Component.postSetupGuide()
Component.alignGuides()
Component.setupRigSettings()
Component.setupInputs()
Component.setupOutputs()
Component.preSetupDeformLayer()
Component.setupDeformLayer()
Component.setupSelectionSet()
Component.postSetupDeform()
Component.preSetupRig()
Component.setupRig()
Component.postSetupRig()
Component.setupSpaceSwitches()
Component.createRigControllerTags()
Component.createGuideControllerTags()
Component.prePolish()
Component.polish()
Component.postPolish()
Component.deleteGuide()
Component.deleteDeform()
Component.deleteRig()
Component.delete()
Component.deserializeComponentConnections()
Component.serializeComponentGuideConnections()
disconnectJointTransforms()
resetJointTransforms()
SpaceSwitchUIDriver
SpaceSwitchUIDriven
- Hive Nodes
SettingsNode
Guide
Guide.id()
Guide.aimToChild()
Guide.aimToGuide()
Guide.isGuide()
Guide.shape()
Guide.shapeNode()
Guide.setShapeParent()
Guide.setParent()
Guide.guideParent()
Guide.isRoot()
Guide.create()
Guide.snapPivot()
Guide.scalePivotComponents()
Guide.scaleAxisComponents()
Guide.scaleShapeComponents()
Guide.replaceShape()
Guide.pivotShapes()
Guide.addShape()
Guide.setDisplayAxisShapeVis()
Guide.displayAxisShapeVis()
Guide.iterChildGuides()
Guide.pivotShapeInfo()
Guide.serializeFromScene()
Guide.deleteShapeTransform()
Guide.delete()
ControlNode
ControlNode.id()
ControlNode.controllerTag()
ControlNode.addControllerTag()
ControlNode.srt()
ControlNode.iterSrts()
ControlNode.setParent()
ControlNode.create()
ControlNode.addShapeFromLib()
ControlNode.addShapeFromData()
ControlNode.annotation()
ControlNode.deleteAnnotation()
ControlNode.delete()
ControlNode.serializeFromScene()
Joint
Annotation
InputNode
OutputNode
setGuidesWorldMatrix()
HiveLayer
HiveLayer.show()
HiveLayer.hide()
HiveLayer.rootTransform()
HiveLayer.createTransform()
HiveLayer.delete()
HiveLayer.metaAttributes()
HiveLayer.updateMetaData()
HiveLayer.createSettingsNode()
HiveLayer.settingsNodes()
HiveLayer.settingNode()
HiveLayer.createJoint()
HiveLayer.findJoints()
HiveLayer.iterJoints()
HiveLayer.addJoint()
HiveLayer.joints()
HiveLayer.disconnectAllJoints()
HiveLayer.deleteJoint()
HiveLayer.iterJointPlugs()
HiveLayer.joint()
HiveLayer.rootJoints()
HiveLayer.addExtraNodes()
HiveLayer.addExtraNode()
HiveLayer.extraNodes()
HiveLayer.addTaggedNode()
HiveLayer.taggedNode()
HiveLayer.taggedNodes()
HiveLayer.findTaggedNodes()
HiveLayer.createAnnotation()
HiveLayer.annotation()
HiveLayer.annotations()
HiveLayer.serializeFromScene()
HiveComponentLayer
HiveComponentLayer.id
HiveComponentLayer.metaAttributes()
HiveComponentLayer.components()
HiveComponentLayer.iterComponents()
HiveComponentLayer.iterGroupPlugs()
HiveComponentLayer.groupElementPlug()
HiveComponentLayer.groupNames()
HiveComponentLayer.removeFromGroup()
HiveComponentLayer.createGroup()
HiveComponentLayer.addToGroup()
HiveComponentLayer.removeGroup()
HiveComponentLayer.iterComponentsNamesForGroup()
HiveInputLayer
HiveInputLayer.id
HiveInputLayer.metaAttributes()
HiveInputLayer.rootInput()
HiveInputLayer.rootIONodes()
HiveInputLayer.rootInputPlug()
HiveInputLayer.createInput()
HiveInputLayer.addInputNode()
HiveInputLayer.deleteInput()
HiveInputLayer.clearInputs()
HiveInputLayer.inputPlugById()
HiveInputLayer.inputSourcePlugById()
HiveInputLayer.inputNode()
HiveInputLayer.findInputNodes()
HiveInputLayer.hasInput()
HiveInputLayer.inputs()
HiveInputLayer.serializeFromScene()
HiveOutputLayer
HiveOutputLayer.id
HiveOutputLayer.metaAttributes()
HiveOutputLayer.rootIONodes()
HiveOutputLayer.addOutputNode()
HiveOutputLayer.outputPlugById()
HiveOutputLayer.outputNodePlugById()
HiveOutputLayer.findOutputNodes()
HiveOutputLayer.outputs()
HiveOutputLayer.hasOutput()
HiveOutputLayer.outputNode()
HiveOutputLayer.createOutput()
HiveOutputLayer.deleteOutput()
HiveOutputLayer.clearOutputs()
HiveOutputLayer.serializeFromScene()
HiveGuideLayer
HiveGuideLayer.id
HiveGuideLayer.serializeFromScene()
HiveGuideLayer.metaAttributes()
HiveGuideLayer.isPinned()
HiveGuideLayer.alignGuides()
HiveGuideLayer.iterGuideCompound()
HiveGuideLayer.addChildGuide()
HiveGuideLayer.createGuide()
HiveGuideLayer.duplicateGuide()
HiveGuideLayer.guideSettings()
HiveGuideLayer.createSrtBuffer()
HiveGuideLayer.deleteGuides()
HiveGuideLayer.srt()
HiveGuideLayer.findGuides()
HiveGuideLayer.isGuidesVisible()
HiveGuideLayer.isGuideControlVisible()
HiveGuideLayer.setGuideControlVisible()
HiveGuideLayer.setGuidesVisible()
HiveGuideLayer.guide()
HiveGuideLayer.iterGuides()
HiveGuideLayer.guideCount()
HiveGuideLayer.guidePlugById()
HiveGuideLayer.guideNodePlugById()
HiveGuideLayer.sourceGuidePlugById()
HiveGuideLayer.guideRoot()
HiveGuideLayer.isLiveLink()
HiveGuideLayer.setLiveLink()
HiveGuideLayer.setManualOrient()
HiveGuideLayer.delete()
HiveGuideLayer.createNamedGraph()
HiveGuideLayer.hasNamedGraph()
HiveGuideLayer.namedGraph()
HiveGuideLayer.namedGraphs()
HiveGuideLayer.deleteNamedGraph()
HiveGuideLayer.findNamedGraphs()
HiveRigLayer
HiveRigLayer.id
HiveRigLayer.controlPanel()
HiveRigLayer.metaAttributes()
HiveRigLayer.createSelectionSet()
HiveRigLayer.selectionSet()
HiveRigLayer.createSpaceSwitch()
HiveRigLayer.addSpaceSwitchNode()
HiveRigLayer.spaceSwitches()
HiveRigLayer.createControl()
HiveRigLayer.control()
HiveRigLayer.controlForSrt()
HiveRigLayer.srts()
HiveRigLayer.srt()
HiveRigLayer.createSrtBuffer()
HiveRigLayer.addControl()
HiveRigLayer.iterControlPlugs()
HiveRigLayer.iterControls()
HiveRigLayer.findControls()
HiveRigLayer.controlPlugById()
HiveRigLayer.serializeFromScene()
HiveRigLayer.createNamedGraph()
HiveRigLayer.hasNamedGraph()
HiveRigLayer.namedGraph()
HiveRigLayer.namedGraphs()
HiveRigLayer.deleteNamedGraph()
HiveRigLayer.findNamedGraphs()
HiveDeformLayer
HiveDeformLayer.id
HiveDeformLayer.metaAttributes()
HiveDeformLayer.isLiveLink()
HiveDeformLayer.createSelectionSet()
HiveDeformLayer.selectionSet()
HiveDeformLayer.delete()
HiveDeformLayer.setLiveLink()
HiveDeformLayer.activateLiveLink()
HiveDeformLayer.deactivateLiveLink()
HiveDeformLayer.serializeFromScene()
HiveGeometryLayer
HiveXGroupLayer
HiveComponent
HiveComponent.id
HiveComponent.delete()
HiveComponent.serializeFromScene()
HiveComponent.metaAttributes()
HiveComponent.rawDefinitionData()
HiveComponent.saveDefinitionData()
HiveComponent.rootTransform()
HiveComponent.createTransform()
HiveComponent.outputLayer()
HiveComponent.inputLayer()
HiveComponent.guideLayer()
HiveComponent.rigLayer()
HiveComponent.deformLayer()
HiveComponent.geometryLayer()
HiveComponent.xGroupLayer()
HiveComponent.layers()
HiveComponent.layerIdMapping()
HiveComponent.layersById()
HiveComponent.layer()
HiveComponent.createLayer()
HiveRig
HiveRig.id
HiveRig.delete()
HiveRig.deleteControlDisplayLayer()
HiveRig.rigName()
HiveRig.setBuildScriptConfig()
HiveRig.buildScriptConfig()
HiveRig.metaAttributes()
HiveRig.selectionSets()
HiveRig.createSelectionSets()
HiveRig.componentLayer()
HiveRig.geometryLayer()
HiveRig.deformLayer()
HiveRig.rootTransform()
HiveRig.createTransform()
HiveRig.layers()
HiveRig.layer()
HiveRig.createLayer()
- Definition
GuideLayerDefinition
GuideLayerDefinition.fromData()
GuideLayerDefinition.update()
GuideLayerDefinition.defaultGuideSettings()
GuideLayerDefinition.mergeDefaultSettings()
GuideLayerDefinition.defaultMetadataSettings()
GuideLayerDefinition.mergeDefaultMetaData()
GuideLayerDefinition.iterGuides()
GuideLayerDefinition.hasGuides()
GuideLayerDefinition.guideCount()
GuideLayerDefinition.guide()
GuideLayerDefinition.findGuides()
GuideLayerDefinition.hasGuideSetting()
GuideLayerDefinition.addGuideSetting()
GuideLayerDefinition.guideSetting()
GuideLayerDefinition.iterGuideSettings()
GuideLayerDefinition.guideSettings()
GuideLayerDefinition.deleteGuides()
GuideLayerDefinition.deleteSettings()
GuideLayerDefinition.deleteSetting()
GuideLayerDefinition.addGuide()
GuideLayerDefinition.hasGuide()
GuideLayerDefinition.createGuide()
GuideLayerDefinition.setGuideParent()
RigLayerDefinition
RigLayerDefinition.fromData()
RigLayerDefinition.update()
RigLayerDefinition.setSettingValue()
RigLayerDefinition.addSetting()
RigLayerDefinition.addSettings()
RigLayerDefinition.insertSettingByName()
RigLayerDefinition.insertSetting()
RigLayerDefinition.insertSettings()
RigLayerDefinition.settingIndex()
RigLayerDefinition.deleteSettings()
RigLayerDefinition.deleteSetting()
RigLayerDefinition.setting()
InputLayerDefinition
InputLayerDefinition.fromData()
InputLayerDefinition.update()
InputLayerDefinition.input()
InputLayerDefinition.iterInputs()
InputLayerDefinition.clearInputs()
InputLayerDefinition.addInput()
InputLayerDefinition.createInput()
InputLayerDefinition.inputSetting()
InputLayerDefinition.addInputSetting()
InputLayerDefinition.deleteInputs()
OutputLayerDefinition
OutputLayerDefinition.fromData()
OutputLayerDefinition.update()
OutputLayerDefinition.output()
OutputLayerDefinition.iterOutputs()
OutputLayerDefinition.clearOutputs()
OutputLayerDefinition.createOutput()
OutputLayerDefinition.addOutput()
OutputLayerDefinition.outputSetting()
OutputLayerDefinition.addOutputSetting()
OutputLayerDefinition.deleteOutputs()
DeformLayerDefinition
DeformLayerDefinition.fromData()
DeformLayerDefinition.update()
DeformLayerDefinition.clearJoints()
DeformLayerDefinition.createJoint()
DeformLayerDefinition.joint()
DeformLayerDefinition.findJoints()
DeformLayerDefinition.addJoint()
DeformLayerDefinition.iterDeformJoints()
DeformLayerDefinition.deleteJoints()
NamedGraphs
NamedGraph
TransformDefinition
TransformDefinition.DEFAULTS
TransformDefinition.translate
TransformDefinition.rotate
TransformDefinition.scale
TransformDefinition.matrix
TransformDefinition.worldMatrix
TransformDefinition.attribute()
TransformDefinition.iterChildren()
TransformDefinition.deserialize()
TransformDefinition.copy()
TransformDefinition.deleteChild()
TransformDefinition.localTransformationMatrix()
TransformDefinition.transformationMatrix()
JointDefinition
InputDefinition
OutputDefinition
ControlDefinition
GuideDefinition
AttributeDefinition
VectorAttributeDefinition
attributeClassForDef()
- Build Scripting
BaseBuildScript
BaseBuildScript.id
BaseBuildScript.properties()
BaseBuildScript.rig
BaseBuildScript.preGuideBuild()
BaseBuildScript.postGuideBuild()
BaseBuildScript.preDeformBuild()
BaseBuildScript.postDeformBuild()
BaseBuildScript.preRigBuild()
BaseBuildScript.postRigBuild()
BaseBuildScript.postPolishBuild()
BaseBuildScript.preDeleteGuideLayer()
BaseBuildScript.preDeleteDeformLayer()
BaseBuildScript.preDeleteRigLayer()
BaseBuildScript.preDeleteComponents()
BaseBuildScript.preDeleteComponent()
BaseBuildScript.preDeleteRig()
- Exporter Plugins
- Utils
- Hive Commands
createRig()
renameRig()
deleteRig()
createComponents()
deleteComponents()
duplicateComponents()
updateGuideSettings()
showComponents()
hideComponents()
toggleBlackBox()
setComponentParent()
setComponentSide()
renameComponent()
matchIKFK()
FixFkRotations()
recalculatePoleVector()
setDeformVisibility()
mirrorComponents()
applySymmetry()
buildGuides()
buildDeform()
buildRigs()
polishRig()
saveTemplate()
loadTemplate()
deleteTemplate()
updateRigConfiguration()
setFkGuideParent()
addFkGuide()
autoAlignGuides()
setGuideLRA()
- Hive Naming
MissingPresetPath
PresetManager
PresetManager.ENV_VAR
PresetManager.savePreset()
PresetManager.availableConfigTypes()
PresetManager.updateAvailableConfigTypes()
PresetManager.containsPath()
PresetManager.findPreset()
PresetManager.createPreset()
PresetManager.removePreset()
PresetManager.deletePreset()
PresetManager.configSaveFolder()
PresetManager.saveConfig()
PresetManager.loadFromEnv()
PresetManager.loadFromFile()
PresetManager.loadFromDirectoryPath()
PresetManager.hierarchyData()
Preset
NameConfigData
surroundTextAsField()
uniqueNameForComponentByRig()
uniqueNameForRig()
composeComponentRootNames()
composeRigNamesForLayer()
composeNamesForLayer()
composeContainerName()
composeAnnotationGrpName()
composeSettingsName()
- Named Graphs
NamedNodeAlreadyExists
NamedInputAlreadyExists
NamedOutputAlreadyExists
NamedDGGraph
NamedDGGraph.inputDataToGraph()
NamedDGGraph.outputDataToGraph()
NamedDGGraph.create()
NamedDGGraph.graphId()
NamedDGGraph.setGraphId()
NamedDGGraph.name()
NamedDGGraph.rename()
NamedDGGraph.version()
NamedDGGraph.metaData()
NamedDGGraph.clearNodes()
NamedDGGraph.clearInputs()
NamedDGGraph.clearOutputs()
NamedDGGraph.hasNode()
NamedDGGraph.node()
NamedDGGraph.nodes()
NamedDGGraph.hasPrimaryInputNode()
NamedDGGraph.hasPrimaryOutputNode()
NamedDGGraph.primaryInputNode()
NamedDGGraph.primaryOutputNode()
NamedDGGraph.createIONodes()
NamedDGGraph.delete()
NamedDGGraph.deleteIONodes()
NamedDGGraph.addNode()
NamedDGGraph.addInput()
NamedDGGraph.renameInput()
NamedDGGraph.renameOutput()
NamedDGGraph.addOutput()
NamedDGGraph.findNodes()
NamedDGGraph.inputs()
NamedDGGraph.outputs()
NamedDGGraph.inputAttr()
NamedDGGraph.outputAttr()
NamedDGGraph.setInputAttr()
NamedDGGraph.connectToInput()
NamedDGGraph.connectFromOutput()
NamedDGGraph.serializeIO()
NamedDGGraph.externalConnections()
NamedDGGraph.serialize()
createNamedGraph()
hasNamedGraph()
namedGraph()
namedGraphs()
findNamedGraphs()
deleteNamedGraph()
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
- serialize(rig)¶
- 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
- 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
- Returns
The naming configuration Manager instance
- Return type
- 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.
- 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
rig (
zoo.libs.hive.base.rig.Rig
) – The rig instance to update.config (dict[str,dict]) – The configuration data for any/all buildscripts for the current rig.
- 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.
- 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
- loadComponentDefinition(componentType)¶
- initComponentDefinition(componentType)¶
- graphPaths()¶
- 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 graphRegistry()¶
Returns the current graph registry instance.
- Return type
registry.GraphRegistry
- 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)¶
- initializeGraphRegistry(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 creation of 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
baseDef.ComponentDefinition
or None
- fromMetaNode(rig, metaNode)¶
Create a new component of a specified type and attach it to a rig.
- Parameters
rig (
Rig
) – The rig to which the new component will be attached.metaNode (
zoo.libs.hive.base.hivenodes.HiveComponent
) – The metadata for the new component.
- Raises
MissingRootTransform – If the provided metaNode does not have a root transform.
- Returns
A new component of the specified type, initialized with the provided rig and metaNode.
- Return type
- 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.
- saveComponentDefinition(definition)¶
Saves the definition object by overwrite the existing one.
- Parameters
definition (
baseDef.ComponentDefinition
) – The definition object to save.- Return type
- 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¶
A property that returns a dictionary of templates in the form of {“templateName”: “templatePath”}.
- Returns
A dictionary where the keys are template names and the values are template file paths.
- Return type
- refresh()¶
Refreshes the library by clearing the registry then rediscovering the component plugins
- saveTemplate(name, template, templateRootPath=None, overwrite=False)¶
Save a template to the specified location on the file system.
- Parameters
name (str) – The name of the template.
template (dict) – The template data to be saved.
templateRootPath (str, optional) – The root directory where the template should be saved. If not specified, the default save location will be used.
overwrite (bool, optional) – Indicates whether to overwrite an existing template with the same name. If False and a template with the same name already exists, a TemplateAlreadyExistsError will be raised.
- Raises
TemplateAlreadyExistsError – If a template with the same name already exists and overwrite is False.
IOError – If there was an error writing the template to the specified file path.
- Returns
The file path where the template was saved.
- Return type
- saveComponentsAsTemplate(rig, components, name, templateRootPath, overwrite)¶
Save the specified components as a template.
- Parameters
rig (Rig) – The rig containing the components.
components (list) – The components to be saved as a template.
name (str) – The name of the template.
templateRootPath (str) – The root directory where the template should be saved.
overwrite (bool) – Indicates whether to overwrite an existing template with the same name. If False and a template with the same name already exists, a TemplateAlreadyExistsError will be raised.
- Returns
The file path where the template was saved.
- Return type
- renameTemplate(name, newName)¶
Rename a template.
- deleteTemplate(name)¶
Delete a template with the specified name.
- hasTemplate(name)¶
Checks whether the registry contains the template with the name.
- template(name)¶
Returns the rig template dict from the registry
- templatePath(name)¶
Get the file path for the template with the specified name.
- addTemplate(path)¶
Add a template to the registry.
- Parameters
path (str) – The file path for the template.
- discoverTemplates()¶
Discovers all templates in the given paths and stores them in the registry.
- class GraphRegistry(*args, **kwargs)¶
Bases:
object
Class to handle hive DependencyGraphs.
This class is a singleton, meaning that there will always be only one instance of it.
- property graphs¶
Get the dictionary of graph names to file paths for all graphs in the registry.
- Returns
A dictionary of graph names to file paths.
- Return type
- refresh()¶
Refreshes the library by clearing the registry then rediscovering the component plugins
- saveGraph(name, namedGraph)¶
Save a graph with the specified name.
- Parameters
name (str) – The name of the graph.
namedGraph (
zoo.libs.hive.base.serialization.dggraph.NamedDGGraph
) – The graph to be saved.
- Returns
The file path where the graph was saved.
- Return type
- renameGraph(name, newName)¶
Rename a graph in the registry.
- hasGraph(name)¶
Checks whether the registry contains the graph with the name.
- graph(name)¶
Returns the rig template dict from the registry
- Parameters
name (str) – the graph name
- Returns
- Return type
baseDef.NamedGraph
- graphPath(name)¶
Returns the file path of the graph with the given name.
- addGraph(path)¶
Add a graph to the registry.
- Parameters
path (str) – The file path of the graph to add.
- discoverTemplates()¶
Find all graph files in the graph roots and add them to the registry.
Errors¶
- exception HiveRigDuplicateRigsError(dupes, *args, **kwargs)¶
Bases:
HiveError
- msg = 'Duplicate rigs in the scene, please use namespace filtering: {}'¶
- exception ComponentDoesntExistError(msg='', *args, **kwargs)¶
Bases:
HiveError
- msg = "Component doesn't exist in the scene: "¶
- exception ComponentGroupAlreadyExists(msg='', *args, **kwargs)¶
Bases:
HiveError
- msg = 'Component group already exists for this rig instance'¶
- exception TemplateAlreadyExistsError(msg='', *args, **kwargs)¶
Bases:
HiveError
- msg = 'Template path: {} already exists!'¶
- exception TemplateMissingComponents(msg='', *args, **kwargs)¶
Bases:
HiveError
- msg = 'No Components specified in template: {}'¶
- exception TemplateRootPathDoesntExist(msg='', *args, **kwargs)¶
Bases:
HiveError
- msg = "Template root path doesn't exist on disk: {}"¶
- exception InvalidInputNodeMetaData(msg='', *args, **kwargs)¶
Bases:
HiveError
- msg = 'InputLayer meta data is missing inputNode connection'¶
- exception InvalidOutputNodeMetaData(msg='', *args, **kwargs)¶
Bases:
HiveError
- msg = 'OutputLayer meta data is missing outputNode connection'¶
- exception InitializeComponentError(componentName, *args, **kwargs)¶
Bases:
HiveError
- msg = 'Failed to initialize component: {}'¶
- exception MissingRootTransform(metaName, *args, **kwargs)¶
Bases:
HiveError
- msg = 'Missing Root transform on meta node: {}'¶
- exception RootNamespaceActiveError(msg='', *args, **kwargs)¶
Bases:
HiveError
- msg = 'Current namespace is already the root'¶
- exception BuildComponentGuideUnknownError(msg='', *args, **kwargs)¶
Bases:
HiveError
- msg = 'Unknown build guide error'¶
- exception BuildComponentRigUnknownError(msg='', *args, **kwargs)¶
Bases:
HiveError
- msg = 'Unknown build Rig error'¶
- exception MissingRigForNode(msg='', *args, **kwargs)¶
Bases:
HiveError
- msg = 'Node is not attached to a rig'¶
- exception MissingMetaNode(msg='', *args, **kwargs)¶
Bases:
HiveError
- msg = 'Attached meta node is not a valid hive node'¶
- exception MissingComponentType(componentName, *args, **kwargs)¶
Bases:
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:
HiveError
- msg = 'Missing Control by id : {}'¶
- exception UnSupportedConnectableNode(msg='', *args, **kwargs)¶
Bases:
HiveError
- msg = "Attempting to connect to unsupported guide: '{}'"¶
- exception InvalidDefinitionAttrExpression¶
Bases:
Exception
- exception InvalidDefinitionAttrForSceneNode¶
Bases:
Exception