On this page | |
Inheritance |
|
Overview ¶
hou.GadgetContext
provides a common interface to viewer resources such as
Python viewer handles and Python viewer states. It holds
relevant information about a gadget drawable or 2D drawable that
is bound to the viewer resource currently active in a viewport. The term drawable
is used interchangeably to refer to either a
hou.GadgetDrawable or a hou.Drawable2D.
Methods ¶
name()
→ string
Returns the name of the active drawable. A drawable is active when it is picked or when the mouse moves over its visuals (located).
label()
→ string
The active drawable label name.
gadget()
→ string
Similar to name().
gadgetLabel()
→ string
Similar to label().
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.
Note
This method does not apply to hou.Drawable2D objects.
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.
Note
This method does not apply to hou.Drawable2D objects.
isDrawing()
→ bool
Returns True if the handle is in a drawing state which means no drawable is being picked or located.
isPicking()
→ bool
Returns True if any drawable is being picked.
isLocating()
→ bool
Returns True if any drawable is being located.
isLocated(drawable_name)
→ bool
Returns True if a given drawable is located.
drawable_name
Name of the drawable to test.
isPicked(drawable_name)
→ bool
Returns True if a given drawable is picked.
drawable_name
Name of the drawable to test.
See also |