You can create a new visualizer by calling hou.viewportVisualizers.createVisualizer. You can get a list of registered visualizers by calling hou.viewportVisualizers.visualizers.
Methods ¶
name()
→ string
Return the visualizer’s unique identifier.
setName(name)
Set the visualizer’s unique identifier.
label()
→ string
Return the visualizer’s user-friendly label.
setLabel(label)
Set the visualizer’s user-friendly label.
icon()
→ string
Return the name of the visualizer’s icon.
setIcon(icon)
Set the visualizer’s icon. icon
must be the icon name.
isActive(viewport=None)
→ bool
If this is a Common or Scene visualizer then return True if it is active
for the specified viewport or False otherwise. The viewport
argument
must be a hou.GeometryViewport object.
If this is a Node visualizer then return True if it is active for all viewports and False otherwise.
Raise TypeError
if this is a Node visualizer and the viewport
argument is not None. Node visualizers are either active in all viewports
or none of them. They cannot be activated for a specific viewport.
Raise TypeError
if this is either a Common or Scene visualizer
and the viewport
argument is None.
setIsActive(on, viewport=None)
If this is a Common or Scene visualizer then set whether it is active
or not for a specified viewport. The viewport
argument must be a
hou.GeometryViewport object.
If this is a Node visualizer then set whether it is active or not for all viewports.
Raise TypeError
if this is a Node visualizer and the viewport
argument is not None. Node visualizers are either active in all viewports
or none of them. They cannot be activated for a specific viewport.
Raise TypeError
if this is either a Common or Scene visualizer
and the viewport
argument is None.
setType(type)
Sets the visualizer’s type. This essentially recreates the visualizer and rebuilds its customizable parameters. Call hou.ViewportVisualizer.parmNames to get a list of the parameters.
category()
→ hou.viewportVisualizerCategory
Return the category that the visualizer belongs to.
categoryNode()
→ hou.OpNode
Return the node that the visualizer is installed on. This only applies if the visualizer belongs to the Node
category.
Return None if the visualizer belongs to either the Common
or Scene
category.
scope()
→ hou.viewportVisualizerScope
Return the scope of geometries that the visualizer affects.
setScope(scope)
Set the scope of geometries that the visualizer affects.
This method does nothing if the visualizer belongs to the Common
or Scene
because the scope is always global.
isShownInToolbar()
→ bool
Return True if the visualizer appears in the viewer pane’s toolbar. Return False otherwise.
showInToolbar(on)
Set whether the visualizer appears in the viewer pane’s toolbar.
isActiveWhenUnselected()
→ bool
Return True if the visualizer is applied when the geometry is unselected. Return False otherwise.
setIsActiveWhenUnselected(on)
Set whether the visualizer is applied when the geometry is unselected.
isActiveWhenSelected()
→ bool
Return True if the visualizer is applied when the geometry is selected. Return False otherwise.
setIsActiveWhenSelected(on)
Set whether the visualizer is applied when the geometry is selected.
isActiveWhenGhosted()
→ bool
Return True if the visualizer is applied when the geometry is ghosted. Return False otherwise.
setIsActiveWhenGhosted(on)
Set whether the visualizer is applied when the geometry is ghosted.
isActiveWhenDisplayed()
→ bool
Return True if the visualizer is applied when the geometry is displayed. Return False otherwise.
setIsActiveWhenDisplayed(on)
Set whether the visualizer is applied when the geometry is displayed.
isActiveWhenCurrent()
→ bool
Return True if the visualizer is applied when the geometry is the current geometry. Return False otherwise.
setIsActiveWhenCurrent(on)
Set whether the visualizer is applied when the geometry is the current geometry.
isActiveWhenTemplated()
→ bool
Return True if the visualizer is applied when the geometry is templated.
setIsActiveWhenTemplated(on)
Set whether the visualizer is applied when the geometry is templated.
parmNames()
→ tuple of string
Return a tuple of the visualizer’s customizable parameters. Note that the parameters can change when either the visualizer’s type changes or one of the parameters changes (for example changing the Color Type parameter on a color visualizer).
evalParm(parm_name)
→ int
, float
, or str
Evaluate the specified parameter and return the result.
evalParmAsFloat(parm_name)
→ float
Evaluate the specified parameter and return the result as a float.
Raise TypeError
if the value cannot be converted to a float.
evalParmAsInt(parm_name)
→ int
Evaluate the specified parameter and return the result as an integer.
Raise TypeError
if the value cannot be converted to a integer.
evalParmAsString(parm_name)
→ int
Evaluate the specified parameter and return the result as a string.
Raise TypeError
if the value cannot be converted to a string.
evalParmAsRamp()
→ hou.Ramp
Evalute the specified parameter and return the result as a ramp.
Raises TypeError
if the parameter is not a ramp.
setParm(parm_name, value)
Set the specified parameter’s value.
Pass in a hou.Ramp object, as the parameter value, to set the value of a ramp parameter. The ramp object’s type needs to match the target ramp’s type.
Raise TypeError
if the type of value
does not match the
type of the specified parameter.
destroy()
Delete this viewport visualizer.
If you call methods on a visualizer instance after it has been destroyed, Houdini will raise hou.ObjectWasDeleted.