Read Viewport Drag State (BETA)#

Read the state of the last viewport drag event from the specified viewport. Note that viewport mouse events must be enabled on the specified viewport using a SetViewportMode node.

Installation#

To use this Node, you must enable omni.graph.ui_nodes in the Extension Manager.

Inputs#

Name

Type

Description

Default

Use Normalized Coords (useNormalizedCoords)

bool

When true, the components of 2D position and velocity outputs are scaled to between 0 and 1, where 0 is top/left and 1 is bottom/right. When false, components are in viewport render resolution pixels.

False

Viewport (viewport)

token

Name of the viewport window to watch for drag events

Viewport

Gesture (gesture)

token

The input gesture to trigger viewport drag events

Left Mouse Drag

Outputs#

Name

Type

Description

Default

Initial Position (initialPosition)

double[2]

The mouse position at which the most recent drag began

Current Position (currentPosition)

double[2]

The current mouse position if a drag is in progress, or the final mouse position of the most recent drag if a drag is not in progress

Velocity (velocity)

double[2]

A vector representing the change in position of the mouse since the previous frame if a drag is in progress, otherwise (0,0)

Is Drag In Progress (isDragInProgress)

bool

True if a viewport drag event is currently in progress in the specified viewport

Is Valid (isValid)

bool

True if a valid event state was detected and the outputs of this node are valid, and false otherwise