Methods
__init__()
Create a LopSelectionRule object with default settings.
collectionAwarePaths(lopnode)
→ tuple
of str
Calculates the scene graph primitive selection using the scene graph from the provided LOP node object.
Returns the full paths to every scene graph primitive or collection
matching the selection pattern. Unlike the expandedPaths
method,
collections are not expanded to explicitly list their contents as
primitives. Instead the full path of the collection itself is returned.
If the primitive pattern contains any exclusions the included collections
cannot be accurately tracked, so the results of this method will be the
same as for expandedPaths
.
expandedPaths(lopnode)
→ tuple
of str
Calculates the scene graph primitive selection using the scene graph from the provided LOP node object.
Returns the full paths to every scene graph primitive matching the selection rules. All collections in the path pattern are expanded to list their included prims explicitly.
pathPattern()
→ str
Return the path pattern string used in this selection rule.
setPathPattern(pattern)
Sets the path pattern string used in this selection rule.
baseTypeName()
→ str
Return the name of the USD primitive type that must exist as a base type of any primitive that will be returned by this selection rule.
setBaseTypeName(basetypename)
Sets the name of the USD primitive type that must exist as a base type of any primitive that will be returned by this selection rule.
The following will create a selection rule that returns all lights of any type in a scene:
>>> rule = hou.LopSelectionRule() >>> rule.setPathPattern('*') >>> rule.setBaseTypeName('UsdLuxLight')
traversalDemands()
→ int
Return an integer value that expresses any demands made on the USD primitives while traversing the scene graph looking for matches.
setTraversalDemands(options)
Set demands that must be met by primitives while traversing the scene graph. These demands are expressed as an integer value. This value can be any combination of the hou.lopTraversalDemands values.
Multiple demands can be combined with the |
operator. The following
builds a rule that will only return USD primitives that are active and
defined:
>>> rule = hou.LopSelectionRule() >>> rule.setPathPattern(hou.lopTraversalDemands.Active | hou.lopTraversalDemands.Defined)
includeAncestors()
→ str
Return True
if this object has been configured to return all ancestors
of primitives that match the supplied primitive pattern when calling
expandedPaths
. The defaults for this value is False
.
setIncludeAncestors(pattern)
Sets the flag indicating whether all ancestors of primitives found by the
primitive pattern should also be returned when calling expandedPaths
.
includeDescendants()
→ str
Return True
if this object has been configured to return all descendants
of primitives that match the supplied primitive pattern when calling
expandedPaths
. The defaults for this value is False
.
setIncludeDescendants(pattern)
Sets the flag indicating whether all descendants of primitives found by the
primitive pattern should also be returned when calling expandedPaths
.