An agent definition includes a rig, shape library, layers, and clips, and can be shared between agent primitives. See Agent Primitives for more information.
Since an agent definition is shared between copies of an agent primitive (such as agents in an upstream SOP’s geometry), the definition returned by hou.Agent.definition is read-only. The hou.AgentDefinition.freeze method can be used to create a modifiable copy of an agent definition.
Methods ¶
__init__(rig, shapelib)
Creates a new (and modifiable) agent definition.
rig
The hou.AgentRig that the definition should reference.
shapelib
The hou.AgentShapeLibrary that the definition should reference.
addClip(clip)
Adds a clip to the agent definition.
Raises hou.GeometryPermissionError if the agent definition is not modifiable.
Raises hou.OperationFailed if the clip is associated with a different rig.
clip
addLayer(layer)
Adds a layer to the agent definition.
Raises hou.GeometryPermissionError if the agent definition is not modifiable.
Raises hou.OperationFailed if the layer is associated with a different rig or shape library.
layer
addTransformGroup(group)
Adds a transform group to the agent definition.
Raises hou.GeometryPermissionError if the agent definition is not modifiable.
Raises hou.OperationFailed if the group is associated with a different rig.
group
clips()
→ tuple
of hou.AgentClip
Returns a list of the clips in the agent definition.
findClip(name)
→ hou.AgentClip
Finds the clip with the specified name, or None if no such clip exists.
findLayer(name)
→ hou.AgentLayer
Finds the layer with the specified name, or None if no such layer exists.
findTransformGroup(name)
→ hou.AgentTransformGroup
Finds the transform group with the specified name, or None if no such group exists.
freeze(new_shapelib = None, new_rig = None)
→ hou.AgentDefinition
Creates a modifiable copy of the agent definition. Use hou.Agent.setDefinition to change one or more agents to use the new agent definition.
new_shapelib
If specified, the copied agent definition and its layers will reference the new shape library.
new_rig
If specified, the copied agent definition (and its clips, layers, and transform groups) will reference the new rig.
layers()
→ tuple
of hou.AgentLayer
Returns a list of the layers in the agent definition.
metadata()
→ hou.AgentMetadata
Returns the agent definition’s metadata.
This may return None
if the agent definition does not have any metadata.
removeClip(name)
Removes a clip from the agent definition.
Raises hou.GeometryPermissionError if the agent definition is not modifiable.
name
The name of the clip to remove.
removeLayer(name)
Removes a layer from the agent definition.
Raises hou.GeometryPermissionError if the agent definition is not modifiable.
name
The name of the layer to remove.
removeTransformGroup(name)
Removes a transform group from the agent definition.
Raises hou.GeometryPermissionError if the agent definition is not modifiable.
name
The name of the transform group to remove.
setMetadata(metadata)
Replaces the agent definition’s metadata. Raises hou.GeometryPermissionError if the agent definition is not modifiable.
metadata
shapeLibrary()
→ hou.AgentShapeLibrary
Returns the agent definition’s shape library.
transformGroups()
→ tuple
of hou.AgentTransformGroup
Returns a list of the transform groups in the agent definition.
See also |