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 the gadget drawables bound to the viewer resource
currently running in the viewport.
Methods ¶
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 |