| Inheritance |
|
Methods ¶
__init__(scene_viewer, handle)
Creates an instance of a 2D handle dragger, such as one used by a COP Python handle.
scene_viewer
A reference to the Scene Viewer in which the dragger will be used.
handle
The handle owner associated with this dragger.
Methods from hou.ViewerDragger2D ¶
update(ui_event)
Updates the dragger using the current frame’s ui_event.
ui_event
A hou.ViewerEvent object containing UI event information. This is typically
the object passed by Houdini to a Python handle or Python state’s onMouseEvent
callback.
startDrag(start_pos, radius=0.0, orient=None, plane_dir=None)
Initializes the dragger before any drag operations take place.
start_pos
A hou.Vector3 object describing the start position of the drag operation on the dragger plane, in world-space coordinates.
radius
The radius of the rotation ring used by dragRotate().
orient
A hou.Matrix3 object representing the orientation in which the dragger operates. Defaults to the identity matrix.
plane_dir
A hou.Vector3 object defining the normal of the plane in which the dragger
operates. Defaults to hou.Vector3(0,0,1).
endDrag()
Ends the current drag operation by releasing any cached data and other temporary state used by the dragger.
dragXY()
Moves the mouse within the dragger plane defined by startDrag(). When is pressed
and the mouse is moving, the dragger constrains the mouse position to the plane.
dragAlongX()
Moves the mouse along the X axis defined by the start position and orientation specified in startDrag().
When the axis is picked with and the mouse is moving, the dragger constrains the mouse movement to the direction of the axis.
dragAlongY()
Moves the mouse along the Y axis defined by the start position and orientation
specified in startDrag(). When the axis is picked with and the mouse is moving,
the dragger constrains the mouse movement to the direction of the axis.
dragRotate()
Moves the mouse in a rotational manner, similar to dragging a rotation ring,
around the center point defined by startDrag(). When the ring is picked with and
the mouse is moving, the dragger constrains the mouse movement to a circular path.
valid()
Returns True if the dragger is ready to use or False otherwise. The dragger startDrag() method
must be called first to make a dragger usable.
position()
→ hou.Vector3
Returns the absolute mouse position for the current drag operation in world-space coordinates. The returned value is relevant for the following operations: hou.ViewerDragger2D.dragXY, hou.ViewerDragger2D.dragAlongX, and hou.ViewerDragger2D.dragAlongY.
startPosition()
→ hou.Vector3
Returns the start position used to configure the current drag operation. For the hou.ViewerDragger2D.dragRotate operation, the returned value represents the center of rotation.
startDirection()
→ hou.Vector3
Returns the start direction used for configuring the current drag operation.
startRotatePosition()
→ hou.Vector3
Returns the start position on the rotation ring for the hou.ViewerDragger2D.dragRotate operation.