Vixen
02b45cc4
csharp
public static class BlockoutSurfaces

Doc 24's Surfaces table, run against a scene and put on the undo stack.

Read the guide page for this →

Remarks

What a face is made of and how it is shaded, as against what shape it is. The arithmetic is MeshSurfaces'; the material assignment is the document's, because an AssetReference means nothing to a geometry kernel.

⚠ A material is assigned to a face's group rather than to the face. That is D2's whole reason for having groups: a wall's twelve faces after two bevels are still one wall, and an assignment remembered per face index is one that the next loop cut renumbers out from under. Selecting one face of a wall and assigning brick makes the whole wall brick — which is what somebody who selected a wall meant, and is why "select coplanar" and "select group" are one keystroke each.

⚠ Mapping and smoothing demote a parametric shape and assigning a material does not. A projection writes into the mesh's corner layer, so a shape that stayed parametric would lose it the next time anybody nudged a parameter. A material assignment is on the document beside the mesh and survives a regeneration untouched — so a designer can dress a parametric corridor and still widen it.

Methods (7)

  • public static int Assign(MeshEdit editing, AssetReference material)

    Assigns a material to every group the selection touches.

  • public static bool Regroup(MeshEdit editing)

    Puts the selected faces in a group of their own, so a material can be given to them.

  • public static bool Project(MeshEdit editing, UvProjection projection = World, float scale = 1)

    Projects texture coordinates onto the selected faces.

  • public static bool Transform(MeshEdit editing, Vector2 offset = default(Vector2), float rotation = 0, Vector2 scale = default(Vector2))

    Moves, turns and scales the selected faces' coordinates.

  • public static bool Fit(MeshEdit editing)

    Stretches the selected faces' coordinates to cover exactly one repeat each.

  • public static bool Smooth(MeshEdit editing, bool smooth = true)

    Puts the selected faces in a smoothing group, or takes them out of one.

  • public static bool AutoSmooth(MeshEdit editing, float angle = 0.5235988)

    Groups the whole mesh's faces by how sharply they meet.

Used by (3)

  • BlockoutHistoryTestsVixen.Editor.Blockout.Tests
  • BlockoutModeVixen.Editor.Blockout
  • BlockoutSurfaceTestsVixen.Editor.Blockout.Tests