See Crowd Agents for more information.
Methods ¶
__init__()
Creates an empty (and modifiable) agent shape library.
__init__(geometry, name = "")
Creates a new agent shape library by loading it from its geometry representation.
Raises hou.OperationFailed if the shape library could not be loaded.
geometry
The hou.Geometry to load the shape library from.
name
The name for the new shape library.
__init__(filename, keep_external_ref = True)
Creates a new agent shape library by loading it from the specified geometry file.
Raises hou.OperationFailed if the file does not exist or otherwise cannot be loaded.
filename
A path to a geometry file.
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 shape library file needs to be available when the saved geometry is used (only the path to the shape library is saved in the geometry file).
Otherwise, a copy of the shape library will be inlined when saving out the geometry so that the original shape library file is no longer needed.
addShape(name, geometry)
→ hou.AgentShape
Adds a new shape to the shape library.
Raises hou.GeometryPermissionError if the shape library is not modifiable.
name
The name for the new shape.
geometry
A hou.Geometry containing the shape’s geometry.
data()
→ hou.Geometry
Returns the geometry representation of the shape library, which can be saved to disk.
fileName(expanded = False)
→ str
If the shape library 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
.
freeze(keep_external_ref = False)
→ hou.AgentShapeLibrary
Creates a modifiable copy of the shape library.
keep_external_ref
If the original shape library referenced a file on disk, specifies whether the new shape library should be marked as including the original library. In this situation, saving out the new shape library will only write out shapes that were not included from the original library, along with the path to the included shape library. Otherwise, saving out the new shape library will produce a standalone library containing all of the shapes.
isExternalReference()
→ bool
Returns a bool
indicating whether the shape library references a file on disk.
findShape(shape_name)
→ hou.AgentShape
Finds the shape with the specified name, or None if no such shape exists.
name()
→ str
Returns the name or filename of the shape library.
shapes()
→ tuple
of hou.AgentShape
Returns a list of all shapes in the shape library.