RaptorHotspotApi
Hotspot queries and edits for modules, without the Hotspot internals.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | class | preview, since 0.1.0 |
Mesh and face types are passed through as opaque values.
public static class RaptorHotspotApiProperties
RegistryEpoch
public static int RegistryEpoch { get; }Increments on every RaptorHotspotRegistry.Refresh. Use it to invalidate caches built from the registry.
Methods
AutoPatch
public static int AutoPatch()Resets each target face to its sheet's automatic fit, as one undo step.
Returns: The number of faces changed.
ClearSheetCache
public static void ClearSheetCache()Clears the sheet cache. The next fit measures the sheets again.
CurrentPatch
public static bool CurrentPatch(PolygonMesh mesh, FaceHandle h, out string atlasGuid, out Vector4 rect)Gets the patch shown on a face, as a member GUID and authored rect. For a companion, this is the companion's source panel.
| Parameter | Type | Description |
|---|---|---|
mesh | PolygonMesh | The Block's editable mesh. |
| h | FaceHandle | The face handle. |
atlasGuid | out string | The combo member's GUID. |
rect | out Vector4 | The patch's authored rect. |
Returns: False when the face is not a sheet face or has no patch.
ExtractCompanions
public static int ExtractCompanions(RaptorHotspotAtlas atlas)Creates a sheet's tiling companions, one for every tile-divisible panel shape across its combo. Companions that already exist, matched by name, are skipped.
| Parameter | Type | Description |
|---|---|---|
atlas | RaptorHotspotAtlas | The sheet. |
Returns: The number of companions created.
ExtractCompanions
public static int ExtractCompanions(RaptorHotspotAtlas atlas, Rect? onlyAuthoringRect, RaptorHotspotAtlas onlyMember = null)Creates the companion for the panel whose authored rect is onlyAuthoringRect on onlyMember, or on atlas when onlyMember is null. Does nothing if that panel already has a companion.
| Parameter | Type | Default | Description |
|---|---|---|---|
atlas | RaptorHotspotAtlas | The sheet. | |
onlyAuthoringRect | Rect? | The panel's authored rect, or null for every panel. | |
onlyMember | RaptorHotspotAtlas | null | The combo member the panel is on, or null for the sheet itself. |
Returns: The number of companions created.
ForcedPatch
public static bool ForcedPatch(RaptorMeshEditable block, FaceHandle h, out string atlasGuid, out Vector4 rect)Gets the patch a locked face is forced to, as a member GUID and authored rect.
| Parameter | Type | Description |
|---|---|---|
block | RaptorMeshEditable | The Block's editable mesh. |
| h | FaceHandle | The face handle. |
atlasGuid | out string | The combo member's GUID. |
rect | out Vector4 | The patch's authored rect. |
Returns: False when automatic or not locked.
Notify
public static void Notify(string message)Shows a short toast notification in the open RAPTOR window, the same toast the texture tools use. Does nothing when no RAPTOR window is open.
| Parameter | Type | Description |
|---|---|---|
message | string | The text. |
PickPatch
public static int PickPatch(string primaryGuid, string patchAtlasGuid, Vector4 patchRect)Forces the target faces onto one patch of sheet primaryGuid, as one undo step. The patch is given by member patchAtlasGuid and authored rect patchRect.
| Parameter | Type | Description |
|---|---|---|
primaryGuid | string | The sheet's GUID. |
patchAtlasGuid | string | The combo member's GUID. |
patchRect | Vector4 | The patch's authored rect. |
Returns: The number of faces changed.
RefitLiveBlocks
public static int RefitLiveBlocks()Refits the locked faces that use a changed sheet on every live Block. Call it after a sheet changes, such as after a re-bake or a flag or patch edit.
Returns: The number of Blocks visited.
SheetOfFace
public static RaptorHotspotAtlas SheetOfFace(PolygonMesh mesh, FaceHandle h)Gets the hotspot sheet of a Block face, which is the master of the face's material.
| Parameter | Type | Description |
|---|---|---|
mesh | PolygonMesh | The Block's editable mesh. |
| h | FaceHandle | The face handle. |
Returns: The sheet, or null.
SheetValueHash
public static int SheetValueHash(RaptorHotspotAtlas master, bool persistent)Computes a content hash of a sheet's members, texture sizes, densities and patches. When persistent is true, members are identified by GUID and the hash is stable across sessions. Otherwise they are identified by instance, which suits a per-tick stamp.
| Parameter | Type | Description |
|---|---|---|
master | RaptorHotspotAtlas | The sheet. |
persistent | bool | True to identify members by GUID. |
Returns: The hash.
TargetFaces
public static List<MeshFace> TargetFaces()Gets the Patch Picker's target faces. These are the hosted Mesh tool's texture faces: the selected faces in Face mode, or the Blocks' faces in Object mode.
Returns: A new list, or null when there is no hosted Mesh tool.
Related types
- RaptorHotspotAtlas: Authoring data for a hotspot sheet: a trim or panel material and its patches.
- RaptorMeshEditable: The live editable mesh of a Block.