Get RAPTOR

RaptorSpecialMaterials

The Special tool materials: Skybox, Skybox (Pass-through), NoDraw and Block Light.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorclasspreview, since 0.1.0

Only the strip helper for module-built copies is supported API.

public static class RaptorSpecialMaterials

Properties

Routing

public static bool Routing { get; set; }

Whether the four tool materials behave as special materials. When false, they act as plain materials. Defaults to true. Stored in the editor preferences, read on first use and then cached.

Methods

PreferRealStrips

public static int PreferRealStrips(Sandbox.PolygonMesh mesh, System.Collections.Generic.HashSet<int> strips, Sandbox.PolygonMesh source, System.Collections.Generic.IReadOnlyList<HalfEdgeMesh.HalfEdgeHandle> chosen, float reach)

Replaces special materials on the new faces of a module-built copy. Use it when a module derives a copy of a Block's mesh by cutting along chosen cage edges, which adds new faces between original faces.

Each new face in strips that has a special material gets a real material from the cage edge in chosen that it lies along. A corner patch within 1.5 x reach of a cage vertex gets a real material from that vertex. Only materials already on the Block are used. Call it after the copy's face materials have been restored. When no new face has a special material, nothing changes and the method returns 0.

ParameterTypeDescription
meshSandbox.PolygonMeshThe copy.
stripsSystem.Collections.Generic.HashSet<int>The face indices of the copy's new strip and corner faces.
sourceSandbox.PolygonMeshThe uncut cage, in the same frame as the copy.
chosenSystem.Collections.Generic.IReadOnlyList<HalfEdgeMesh.HalfEdgeHandle>The edges of source that the copy was cut along.
reachfloatThe corner patch reach, in core units.

Returns: The number of faces changed.