Inheritance |
|
This base class provides a common interface for drawables such as hou.GeometryDrawable and hou.TextDrawable. These are advanced drawables used by custom python states for drawing text and guide geometries in the viewport and, to convey visual information from the state to the user.
Methods ¶
setParams(params)
Sets the parameters of the drawable. The settings will take effect in the viewport the next time hou.AdvancedDrawable.draw is called.
params
A dictionary of parameters for setting the drawable options. Each drawable type uses a specific set of parameters, detailed information can be found in the drawable derived class params documentation such as GeometryDrawable and TextDrawable.
The following are parameters common to all hou.AdvancedDrawable
types:
|
Vector representing an For hou.TextDrawable, |
|
|
Vector representing an For instance, |
|
|
double |
Value used as the occlusion factor of the overlay in areas occluded by the existing geometry as determined by the depth buffer. A fade factor of 1.0 means no distinction must be made and a value of 0.0 completely hides occluded parts. Defaults to 0. |
|
int |
Sets the glow width value. For instance, this changes the glow width of line segments or text. Defaults to 0. |
|
Sets the mode for highlighting the generated matte of the drawable. Defaults to hou.drawableHighlightMode.Matte. |
|
|
hou.Vector3 or sequence of 3 doubles |
Position of the geometry in 3D space. For hou.TextDrawable, it’s the position of the text to display in viewport coordinates. Defaults to hou.Vector3(0, 0, 0). |
|
hou.Vector3 or sequence of 3 doubles |
Rotation vector in degrees. Defaults to hou.Vector3(0, 0, 0). |
|
hou.Vector3 or sequence of 3 doubles |
Scaling vector. Defaults to hou.Vector3(1, 1, 1). |
|
Sequence of doubles or ints |
Assigns a 2D window to the viewport, in viewport coordinates, for drawing a geometry. The sequence defines the location and size of the window, and must contain the following values:
|
|
Bool |
Specifies if the drawable should use the |
|
Bool |
Specifies if the drawable should use the |
draw(handle, params=None)
Method implemented by leaf classes to support the drawing of elements in a viewport. This method should normally be called from the python state onDraw or onDrawInterrupt event to render the drawable in the current viewport.
handle
This is an opaque value created by Houdini to render the drawable. This handle
value is passed
to the python state onDraw
callback by Houdini and should be passed directly to the drawable object’s draw
method.
params
An optional dictionary of parameters for setting the drawable parameters. These are the same parameters hou.AdvancedDrawable.setParams is using.
Methods from hou.Drawable ¶
name()
The name of this drawable.
label()
The label of this drawable.
setLabel(label)
Set the label for this drawable.
show(value)
Displays or hides the element attached to this drawable in the viewport. The element will appear the next time the viewer redraws.
value
True
to show the element or False
to hide it.
visible()
→ bool
Returns True if the drawable is visible or not.
setTransform(xform)
Sets the transform matrix of the element attached to this drawable. The changes will appear the next time the viewer redraws.
xform
A hou.Matrix4 transformation matrix to set the element’s translation, rotation, and scale.
transform()
: → hou.Matrix4
Returns the transform matrix of the element attached to the drawable.
See also |