See Agent Layers for more information.
Methods ¶
__init__(filename, rig, shapelib, keep_external_ref = True)
Creates a new agent layer by loading it from the specified JSON file.
Raises hou.OperationFailed if the file does not exist or otherwise cannot be loaded.
filename
A path to a JSON file.
rig
The hou.AgentRig that the layer will be associated with.
shapelib
The hou.AgentShapeLibrary that the layer will be associated with.
keep_external_ref
A bool
indicating whether the external reference should be maintained when the agent is saved to a geometry file.
If the reference is maintained, then the layer file needs to be available when the saved geometry is used (only the path to the layer file is saved in the geometry file).
Otherwise, a copy of the layer will be inlined when saving out the geometry so that the original layer file is no longer needed.
__init__(name, rig, shapelib, shape_bindings, source_layer = None)
Creates a new agent layer with the specified shape bindings.
name
The name of the new layer.
rig
The hou.AgentRig that the layer will be associated with.
shapelib
The hou.AgentShapeLibrary that the layer will be associated with.
shape_bindings
A list of shape bindings to add to the layer.
source_layer
Specifies an optional hou.AgentLayer to copy shape bindings from.
asJSON()
→ str
Returns a string containing the JSON that represents the layer.
bindings(transform = None)
→ tuple
of hou.AgentShapeBinding
Returns the list of shape bindings in the layer.
transform
Index of a transform in the agent’s rig. If specified, only the shape bindings attached to the specified transform will be returned.
fileName(expanded = False)
→ str
If the layer is an external reference, returns the path to the file on disk.
expanded
Specifies whether to expand any variables in the path, such as $HIP
.
isExternalReference()
→ bool
Returns a bool
indicating whether the layer references a file on disk.
deformingBindings()
→ tuple
of hou.AgentShapeBinding
Returns the shape bindings in the layer which reference deforming shapes.
name()
→ str
Returns the name of the layer.
staticBindings()
→ tuple
of hou.AgentShapeBinding
Returns the shape bindings in the layer which reference static shapes.