On this page | |
Inheritance |
|
Overview ¶
A hou.ViewerHandleContext
holds the state related to the running viewer handle. A Viewer handle
context holds the information about the viewer handle gadgets (see hou.GadgetContext) and about
the viewer handle itself, such as the parms states.
Methods ¶
isParameterEnabled(parm_name)
→ bool
parm_name
Returns True
if a given parm name is enabled. The returned
value is typically used in the handle implementation for enabling
or disabling (hide) the functionality that may depend on this parm.
scaleFactor(ref_position)
→ double
This method returns a scale factor that can be used to maintain a fixed scale size of the handle gadgets
when zooming in or out. scaleFactor
is normally used in onDrawSetup.
ref_position
A reference position (related to the handle) used for computing the scale factor. This could be the handle’s pivot position (if one exists) or any other relevant position. If omitted, the reference position is (0,0,0).
scaleValue()
→ double
Returns the handle scale preference value. The handle scale is computed
proportionally to the current viewport size and can be used to scale up handle gadgets to a preferred size.
You would normally call scaleValue
from onDrawSetup.
objectWorldTransform()
→ `hou.Matrix4
Returns the world space transform of the handle’s parent object.
objectLocalTransform()
→ `hou.Matrix4
Returns the local space transform of the handle’s parent object.
Methods from hou.GadgetContext ¶
gadget()
→ string
Returns the name of the active gadget drawable. A gadget is active when it is picked or when the mouse moves over the gadget geometry (located).
gadgetLabel()
→ string
The active gadget label name.
component1()
→ int
A component id of the active gadget geometry. The id refers to either a polygon, a polygon vertex or the start point of a line geometry. Returns -1 if no gadget is active.
component2()
→ int
A component id of the active gadget geometry. The returned id typically identifies the end point of a line geometry. Returns -1 if no line geometry is picked or located or no gadget is active.
isDrawing()
→ bool
Returns True if the handle is in a drawing state which means no gadget is being picked or located.
isPicking()
→ bool
Returns True if any gadget is being picked.
isLocating()
→ bool
Returns True if any gadget is being located.
isLocated(gadget_name)
→ bool
Returns True if a given gadget is located.
gadget_name
Name of the gadget to test.
isPicked(gadget_name)
→ bool
Returns True if a given gadget is picked.
gadget_name
Name of the gadget to test.
See also |