Triggers¶
These are the available callbacks that the 3d view will trigger and can be subscribed
with subscribe method:
Input triggers¶
click: Will be called whenclickevent is triggered on the view.dblclick: Will be called whendblclickevent is triggered on the view.contextmenu: Will be called whencontextmenuevent is triggered on the view.up: Will be called whenmouseuportouchstartevents are triggered on the view.down: Will be called whenmousedownortouchendevents are triggered on the view.move: Will be called whenmousemoveortouchmoveevents are triggered on the view.hover: Will be called when hovering a node.enter: Will be called when the cursor enters the node.leave: Will be called when the cursor leaves the node.wheel: Will be called whenwheelevent is triggered on the view.keydown: Will be called when a keyboard key is pressed while the viewer is focused.keyup: Will be called when when a keyboard key is released while the viewer is focused.
Camera triggers¶
panning: Will be called when the camera moves.
Load triggers¶
load_start: Will be called when a view starts the load process.load_success: Will be called when a view finishes the load process successfully.load_error: Will be called when a view load process finishes with an error.reset: Will be called when the 3d viewer is reset, throughreset(), or if a load fails.end_load_animation: Will be called when the load animation finishes.
Interface triggers¶
fullscreen_enabled: Will be called when full screen is enabled.fullscreen_disabled: Will be called when full screen is disabled.
Misc triggers¶
update: Will be called in every frame.
To standardize and allow the content extension, all these callbacks will receive the following basic Object as first parameter:
action(string): Action ID that triggered the call (from the list above).instance(Viewer3d): Viewer3d Instance that triggered the call.nodes(Viewer3dNode[]):Viewer3dNodearray with the nodes that triggered the call. This array can be empty, for example if aclickis triggered from an empty part of the view, or in case ofpanningtrigger, for example. It can also contain multiple nodes, for example clicking on on an object with another one behind it. They will be ordered by distance.original_event(Event) [optional]: Original event (click, mousemove, etc) object triggered (if any).