OmniGraph Node omni.graph.ui.OnViewportPressed

omni.graph.ui.OnViewportPressed Properties

Name

Value

Version

1

Extension

omni.graph.ui

Has State?

False

Implementation Language

C++

Default Memory Type

cpu

Generated Code Exclusions

None

uiName

On Viewport Pressed (BETA)

__categories

graph:action,ui

Generated Class Name

OgnOnViewportPressedDatabase

Python Module

omni.graph.ui

omni.graph.ui.OnViewportPressed Description

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.

omni.graph.ui.OnViewportPressed Inputs

Name

Type

Default

Required?

Descripton

inputs:gesture

token

Left Mouse Press

Y

The input gesture to trigger viewport press events

displayGroup

parameters

literalOnly

1

allowedTokens

Left Mouse Press,Right Mouse Press,Middle Mouse Press

__allowedTokens

{“LeftMouseDrag”: “Left Mouse Press”, “RightMouseDrag”: “Right Mouse Press”, “MiddleMouseDrag”: “Middle Mouse Press”}

uiName

Gesture

__default

“Left Mouse Press”

inputs:onlyPlayback

bool

True

Y

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

literalOnly

1

uiName

Only Simulate On Play

__default

true

inputs:useNormalizedCoords

bool

False

Y

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.

literalOnly

1

uiName

Use Normalized Coords

__default

false

inputs:viewport

token

Viewport

Y

Name of the viewport window to watch for press events

literalOnly

1

uiName

Viewport

__default

“Viewport”

omni.graph.ui.OnViewportPressed Outputs

Name

Type

Default

Required?

Descripton

outputs:isReleasePositionValid

bool

None

Y

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

uiName

Is Release Position Valid

outputs:pressPosition

double[2]

None

Y

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

uiName

Press Position

outputs:pressed

execution

None

Y

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

uiName

Pressed

outputs:releasePosition

double[2]

None

Y

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)

uiName

Release Position

outputs:released

execution

None

Y

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

uiName

Released