Get RAPTOR

RaptorSuiteApi

The Suite's state and actions for modules in other assemblies.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorclasspreview, since 0.1.0

Each member runs the same code path as the Suite. Controls are made with RaptorSuiteControls, and dialogs derive from RaptorSuiteModuleDialog.

public static class RaptorSuiteApi

Properties

CurrentSuite

public static RaptorSuiteWindow CurrentSuite { get; }

The Suite that dialogs and toasts use: the focused Suite window, or else any open one. Null when none is open.

GeometryMode

public static RaptorGeometryKind GeometryMode { get; }

The Suite's geometry mode, which sets the kind of model new geometry makes and which models are editable. Always Mesh.

Methods

HaloDotted

public static void HaloDotted(Vector3 a, Vector3 b, Color color, float dash)

Draws the draw tool's dotted guide stroke: dashes of color, dash screen pixels long, over a thin dark halo line. Leaves Handles.color set to color. Call it while drawing in a Scene view.

ParameterTypeDescription
aVector3The stroke's start, in world space.
bVector3The stroke's end, in world space.
colorColorThe stroke colour.
dashfloatThe dash length in screen pixels.

HaloLine

public static void HaloLine(Vector3 a, Vector3 b, Color color, float width)

Draws the draw tool's solid guide stroke: color at width over a dark halo width + 2.5 wide. Leaves Handles.color set to color. Call it on Repaint while drawing in a Scene view.

ParameterTypeDescription
aVector3The stroke's start, in world space.
bVector3The stroke's end, in world space.
colorColorThe stroke colour.
widthfloatThe stroke's width in pixels.

HierarchyDropRefusal

public static string HierarchyDropRefusal(Transform target, GameObject go)

Checks whether go may move under target by the Hierarchy drag's rules.

ParameterTypeDescription
targetTransformThe new parent; null means the scene root.
goGameObjectThe object.

Returns: Null when the move is allowed, an empty string when it is refused without a message (for example onto the object itself or where it already is), else the reason.

HierarchyMove

public static int HierarchyMove(Transform target, IList<GameObject> dragged)

Performs a Hierarchy drop. Every object in dragged that may land moves under target and keeps its world pose. The move is one Undo step, and the model rebuilds once.

ParameterTypeDescription
targetTransformThe new parent; null means the scene root.
draggedIList<GameObject>The objects being moved.

Returns: How many objects moved.

HierarchyRefusal

public static string HierarchyRefusal(Transform target, IList<GameObject> dragged)

Gets the first object's refusal when none of dragged may land under target. An empty string means the drop is refused without a message.

ParameterTypeDescription
targetTransformThe new parent; null means the scene root.
draggedIList<GameObject>The objects being moved.

Returns: The refusal, or null when at least one object may land.

InvalidateChrome

public static void InvalidateChrome()

Marks the Suite's cached chrome (the toolbar, bars, panels and Mesh-mode pane images) as stale so it redraws on the next repaint. Call it after a change the Suite can't detect through input, selection, Undo or object-change events.

KindLockReason

public static string KindLockReason(GameObject go)

Gets why go can't be edited because of its model's kind, such as a read-only model of the older kind.

ParameterTypeDescription
goGameObjectThe object.

Returns: The reason, or null when the model kind allows editing.

NeedsBake

public static bool NeedsBake(RaptorModel model)

Whether model's baked mesh is stale or was never baked. Reads the same cached flag as the BAKE pill. False for null.

ParameterTypeDescription
modelRaptorModelThe model.

Returns: True when it needs a bake.

Notify

public static void Notify(string message)

Shows a short toast for 2 seconds over the Suite window, or else over the last active Scene view. An empty message shows nothing.

ParameterTypeDescription
messagestringThe message.

OpenDialog

public static bool OpenDialog(RaptorSuiteModuleDialog dialog)

Opens dialog in CurrentSuite, closing any dialog already showing there.

ParameterTypeDescription
dialogRaptorSuiteModuleDialogThe dialog to open.

Returns: True when the dialog opened. False when no Suite is open, Settings is open, the first-open data folder prompt is showing, or dialog is null.

OpenDialog

public static bool OpenDialog(RaptorSuiteWindow suite, RaptorSuiteModuleDialog dialog)

Opens dialog in suite, closing any dialog already showing there.

ParameterTypeDescription
suiteRaptorSuiteWindowThe Suite window to open it in.
dialogRaptorSuiteModuleDialogThe dialog to open.

Returns: True when the dialog opened. False when suite is null, Settings is open in it, the first-open data folder prompt is showing, or dialog is null.

OpenModuleDialog

public static RaptorSuiteModuleDialog OpenModuleDialog(RaptorSuiteWindow suite)

Gets the module dialog showing in suite.

ParameterTypeDescription
suiteRaptorSuiteWindowThe Suite window.

Returns: The dialog, or null when none is open or a core dialog is open.

SelectedModel

public static RaptorModel SelectedModel()

Gets the model the draw tool's panels act on: the RaptorModel on or above the active selected object.

Returns: The model, or null when no part of a model is selected.