Scripting Sequoia UI Actions¶
Prerequisites¶
The following objects are implemented by the module Thinkbox.Sequoia.Actions
Before calling methods or accessing properties of these objects, you must ensure the module is imported:
import Thinkbox.Sequoia.Actions 1.0
Accessing Properties And Methods Of Action Objects¶
All objects listed below derive from the QAction class.
They expose all properties and public functions of QAction instances, but the following ones are the most useful within the context of Sequoia:
Properties
enabled : bool
iconText : QString
text : QString
toolTip : QString
visible : bool
To see all properties of an action in the Log, you can use the Reflection.methods() function:
Example:
console.log (Reflection.methods( CreatePointLoaderAction ));
In the following example, we will print the QAction properties and their values to the Sequoia Log in a more friendly layout:
Example:
import Thinkbox.Sequoia.Actions 1.0
var props = [ "autoRepeat", "checkable", "checked", "enabled", "font", "icon", "iconText", "iconVisibleInMenu", "menuRole", "priority", "shortcut", "shortcutContext", "softKeyRole", "statusTip", "text", "toolTip", "visible", "whatsThis" ];
var i = 0;
for ( i = 0; i < props.length; i++)
{
var result = eval ("CreatePointLoaderAction." + props[i] );
console.log( props[i] + " --> "+ result );
}
Log Output:
STS: QML: autoRepeat --> true
STS: QML: checkable --> false
STS: QML: checked --> false
STS: QML: enabled --> true
STS: QML: font --> QFont(Source Sans Pro,10,-1,5,50,0,0,0,0,0)
STS: QML: icon --> QVariant(QIcon)
STS: QML: iconText --> New POINT LOADER
STS: QML: iconVisibleInMenu --> true
STS: QML: menuRole --> 1
STS: QML: priority --> 128
STS: QML: shortcut -->
STS: QML: shortcutContext --> 1
STS: QML: softKeyRole --> undefined
STS: QML: statusTip -->
STS: QML: text --> New &POINT LOADER...
STS: QML: toolTip --> Create A New POINT LOADER At World Origin And Browse For A Point File To Load...
STS: QML: visible --> true
STS: QML: whatsThis -->
Public Slots
The most important function exposed by a QAction .trigger()
It lets you trigger the Action and perform its function.
Example:
import Thinkbox.Sequoia.Actions 1.0
CreateViewportPanelAction.trigger();
The above will trigger the action and create a new Viewport panel.
This is equivalent to selecting the New VIEWPORT Panel Action from the Panels menu.
Node Creation Actions¶
CreatePointLoaderAction
Creates a new Point Loader object.
Corresponds to the Create a New Point Loader Object action available in the Create Objects toolbar / Create menu.
CreateRegionOfInterestAction
Creates a new Point Region Of Interest object.
Corresponds to the Create a New Point Region Of Interest Object action available in the Create Objects toolbar / Create menu.
CreateMeshingAction
Creates a new Mesher object.
Corresponds to the Create a New Mesher Object action available in the Create Objects toolbar / Create menu.
CreateUCSAction
Creates a new User Coordinate System object.
Corresponds to the Create a New User Coordinate System Object action available in the Create Objects toolbar / Create menu.
CreateMeshLoaderAction
Creates a new Mesh Loader object.
Corresponds to the Create a New Mesh Loader Object action available in the Create Objects toolbar / Create menu.
CreatePointSurfaceAction
Creates a new Surface Points object.
Corresponds to the Create a New Point Loader Object action available in the Create Objects toolbar / Create menu.
CreateTextureProjectionAction
Creates a new Image Projection object.
Corresponds to the Create a New Image Projection Object action available in the Create Objects toolbar / Create menu.
CreateMarkerAction
Creates a new Marker object.
Corresponds to the Create a New Marker Object action available in the Create Objects toolbar / Create menu.
CreateCameraAction
Creates a new Camera object.
Corresponds to the Create a New Camera Object action available in the Create Objects toolbar / Create menu.
Animation Settings Actions¶
CreateTransformTurnTableAction
Creates a new Turntable Animation node.
Corresponds to the Create a New Turntable Animation action available in the Animation Settings toolbar.
AddTransformKeyframeAction
Creates a new Keyframe in the Animation node if one is connected.
Also creates a new Keyframes Animation node if none is connected to the selected object(s),
Corresponds to the Create an Animation Keyframe action available in the Animation Settings toolbar.
Gizmo Mode Selection Actions¶
ObjectSelectionAction
Opens a modal selection dialog listing all object in the Active Document.
Obsolete, superseeded by the Document Explorer panel.
Not exposed in the UI.
GizmoModeSelectAction
Toggles the Select Tool.
Corresponds to the Select Tool action available in the Transform Tools toolbar.
GizmoModeTranslateActions
Toggles the Move Tool.
Corresponds to the Move Tool action available in the Transform Tools toolbar.
GizmoModeRotateAction
Toggles the Rotate Tool.
Corresponds to the Rotate Tool action available in the Transform Tools toolbar.
GizmoModeScaleAction
Toggles the Scale Tool.
Corresponds to the Scale Tool action available in the Transform Tools toolbar.
GizmoModeMeasureAction
Toggles the Measure Tool.
Corresponds to the Measure Tool action available in the Transform Tools toolbar.
Gizmo Space Mode¶
GizmoWorldSpaceModeAction
Toggles the World Space Transform Mode option.
Corresponds to the World Space Transform Mode action available in the Transform Tools toolbar.
GizmoObjectSpaceModeAction
Toggles the Object Space Transform Mode option.
Corresponds to the Object Space Transform Mode action available in the Transform Tools toolbar.
GizmoCameraSpaceModeAction
Toggles the Camera Space Transform Mode option.
Corresponds to the Camera Space Transform Mode action available in the Transform Tools toolbar.
View Tools¶
ZoomToExtentsAction
Zooms the Active View to the extents of all objects.
Corresponds to the Zoom Extents action available in the View Controls toolbar.
SetGlobalCameraAction
Toggles the Global View for the Active View, locking it to any other Views set to Global View.
Corresponds to the Global View action available in the View Controls toolbar.
SetPerspectiveCameraAction
Toggles Perspective / Orthographic projection of the Active View.
Corresponds to the Global View action available in the View Controls toolbar.
SetCameraDistanceClippingAction
Toggles Distance Clipping in the Active View.
Corresponds to the Distance Clipping action available in the View Controls toolbar.
Viewport Control Actions¶
ViewportCameraMoveForward
Moves the view forward along the -Z axis.
Only available as Keyboard shortcut.
ViewportCameraMoveBackward
Moves the view backward along the Z axis.
Only available as Keyboard shortcut.
ViewportCameraMoveRight
Moves the view to the right along the X axis.
Only available as Keyboard shortcut.
ViewportCameraMoveLeft
Moves the view to the left along the -X axis.
Only available as Keyboard shortcut.
ViewportCameraMoveForwardGround
Moves the view forward parallel to the ground plane.
Only available as Keyboard shortcut.
ViewportCameraMoveBackwardGround
Moves the view backward parallel to the ground plane.
Only available as Keyboard shortcut.
ViewportCameraMoveRightGround
Moves the view to the right parallel to the ground plane.
Only available as Keyboard shortcut.
ViewportCameraMoveLeftGround
Moves the view to the left parallel to the ground plane.
Only available as Keyboard shortcut.
ViewportCameraHome
Resets the Active View to the Home view, respecting the extents of the Home Grid.
Available as Keyboard shortcut
Available from the View options menu.
Available from the Bookmarks panel’s options menu.
ViewportCameraFront
Switches the Active View to Front ortho projection.
Available as Keyboard shortcut
Available from the View options menu.
Available from the Bookmarks panel’s options menu.
ViewportCameraBack
Switches the Active View to Back ortho projection.
Available as Keyboard shortcut
Available from the View options menu.
Available from the Bookmarks panel’s options menu.
ViewportCameraLeft
Switches the Active View to Left ortho projection.
Available as Keyboard shortcut
Available from the View options menu.
Available from the Bookmarks panel’s options menu.
ViewportCameraRight
Switches the Active View to Right ortho projection.
Available as Keyboard shortcut
Available from the View options menu.
Available from the Bookmarks panel’s options menu.
ViewportCameraTop
Switches the Active View to Top ortho projection.
Available as Keyboard shortcut
Available from the View options menu.
Available from the Bookmarks panel’s options menu.
ViewportCameraBottom
Switches the Active View to Bottom ortho projection.
Available as Keyboard shortcut
Available from the View options menu.
Available from the Bookmarks panel’s options menu.
Bookmark Controls¶
CameraNewBookmarkAction
Creates a new Bookmark from the Active View.
Corresponds to the large New Bookmark icon in the Bookmarks panel.
Display HUD Actions¶
SetTripodVisibilityAction
Toggles the Axis Tripod display in the Active View.
SetGridVisibilityAction
Toggles the Home Grid display in the Active View.
SetFPSVisibilityAction
Toggles the Frame Rate display in the Active View.
SetCameraFocusVisiblityAction
Toggles the View Focus crosshair display in the Active View.
Display Actions¶
SetPRTTextureAction
Toggles the Image Projections display on Points in the Active View.
SetMeshTextureAction
Toggles the Image Projections display on Meshes in the Active View.
SetPRTLightAction
Toggles the Lighting of Points in the Active View.
SetMeshLightAction
Toggles the Lighting of Meshes in the Active View.
SetRigLightAction
Toggles the 2-Lights Rig Illumination in the Active View.
SetHeadLightAction
Toggles the Head Light Illumination in the Active View.
SetWireFrameModeAction
Toggles the Wireframe display of Meshes in the Active View.
SetFlatShadingModeAction
Toggles the Flat Shading display of Meshes in the Active View.