---
breadcrumbs: Houdini 22.0 > Python scripting > hou
title: hou.ViewerHandleDragger2D
nodeType: class
source: https://www.sidefx.com/docs/houdini/hom/hou/ViewerHandleDragger2D
generated_at: 2026-07-30T14:46:25.111Z
---

# hou.ViewerHandleDragger2D class

> Represents a dragger that can be used with Python viewer handles in a 2D space.

<h2 id="methods">Methods</h2>

`__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](/docs/houdini/hom/hou/SceneViewer) in which the dragger will be used.

**handle**  
The [handle owner](/docs/houdini/hom/hou/Handle) associated with this dragger.

Creates an instance of a 2D handle dragger, such as one used by a COP Python handle.

<h2 id="methods-from-hou-viewerdragger2d">Methods from [hou.ViewerDragger2D](/docs/houdini/hom/hou/ViewerDragger2D)</h2>

`update(ui_event)`

Updates the dragger using the current frame’s [ui\_event](/docs/houdini/hom/hou/ViewerEvent).

**ui_event**  
A [hou.ViewerEvent](/docs/houdini/hom/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.

Updates the dragger using the current frame’s ui\_event.

`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](/docs/houdini/hom/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](/docs/houdini/hom/hou/Matrix3) object representing the orientation in which the dragger operates. Defaults to the identity matrix.

**plane_dir**  
A [hou.Vector3](/docs/houdini/hom/hou/Vector3) object defining the normal of the plane in which the dragger operates. Defaults to hou.Vector3(0,0,1) .

Initializes the dragger before any drag operations take place.

`endDrag()`

Ends the current drag operation by releasing any cached data and other temporary state used by the dragger.

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 <kbd>LMB</kbd> is pressed and the mouse is moving, the dragger constrains the mouse position to the plane.

Moves the mouse within the dragger plane defined by startDrag().

`dragAlongX()`

Moves the mouse along the X axis defined by the start position and orientation specified in `startDrag()`. When the axis is picked with <kbd>LMB</kbd> and the mouse is moving, the dragger constrains the mouse movement to the direction of the axis.

Moves the mouse along the X axis defined by the start position and orientation specified in startDrag().

`dragAlongY()`

Moves the mouse along the Y axis defined by the start position and orientation specified in `startDrag()`. When the axis is picked with <kbd>LMB</kbd> and the mouse is moving, the dragger constrains the mouse movement to the direction of the axis.

Moves the mouse along the Y axis defined by the start position and orientation specified in startDrag().

`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 <kbd>LMB</kbd> and the mouse is moving, the dragger constrains the mouse movement to a circular path.

Moves the mouse in a rotational manner, similar to dragging a rotation ring, around the center point defined by startDrag().

`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.

Returns True if the dragger is ready to use or False otherwise.

`position()` → [hou.Vector3](/docs/houdini/hom/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](/docs/houdini/hom/hou/ViewerDragger2D#dragXY), [hou.ViewerDragger2D.dragAlongX](/docs/houdini/hom/hou/ViewerDragger2D#dragAlongX), and [hou.ViewerDragger2D.dragAlongY](/docs/houdini/hom/hou/ViewerDragger2D#dragAlongY).

Returns the absolute mouse position for the current drag operation in world-space coordinates.

`startPosition()` → [hou.Vector3](/docs/houdini/hom/hou/Vector3)

Returns the start position used to configure the current drag operation. For the [hou.ViewerDragger2D.dragRotate](/docs/houdini/hom/hou/ViewerDragger2D#dragRotate) operation, the returned value represents the center of rotation.

Returns the start position used to configure the current drag operation.

`startDirection()` → [hou.Vector3](/docs/houdini/hom/hou/Vector3)

Returns the start direction used for configuring the current drag operation.

Returns the start direction used for configuring the current drag operation.

`startRotatePosition()` → [hou.Vector3](/docs/houdini/hom/hou/Vector3)

Returns the start position on the rotation ring for the [hou.ViewerDragger2D.dragRotate](/docs/houdini/hom/hou/ViewerDragger2D#dragRotate) operation.

Returns the start position on the rotation ring for the hou.ViewerDragger2D.dragRotate operation.