On Viewport Pressed (BETA)

Event node which fires when the specified viewport is pressed, and when that press is released. 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 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 press events

Viewport

Gesture (gesture)

token

The input gesture to trigger viewport press events

Left Mouse Press

Only Simulate On Play (onlyPlayback)

bool

When true, the node is only computed while Stage is being played

True

Outputs

Name

Type

Description

Default

Pressed (pressed)

execution

Enabled when the specified viewport is pressed, populating ‘Press Position’ with the current mouse position

Released (released)

execution

Enabled when the press is released, populating ‘Release Position’ with the current mouse position and setting ‘Is Release Position Valid’ to true if the press is released inside of the viewport. If the press is released outside of the viewport, ‘Is Release Position Valid’ is set to false and ‘Release Position’ is set to (0,0).

Press Position (pressPosition)

double[2]

The position at which the viewport was pressed (valid when either ‘Pressed’ or ‘Released’ is enabled)

Release Position (releasePosition)

double[2]

The position at which the press was released, or (0,0) if the press was released outside of the viewport or the viewport is currently pressed (valid when ‘Ended’ is enabled and ‘Is Release Position Valid’ is true)

Is Release Position Valid (isReleasePositionValid)

bool

True if the press was released inside of the viewport, and false otherwise