Vixen
02b45cc4
csharp
public sealed class SceneMeshData

An editable mesh as a scene file carries it: four flat lists and nothing else.

Read the guide page for this →

Remarks

The file's shape rather than the kernel's. Vixen.Geometry's EditMesh has spans, a lazily-rebuilt edge table and layers; none of that is a thing to write down. What has to survive a save is the four facts everything else is derived from — where the shared positions are, which positions each corner names, how many corners each face has, and which group each face is in — and this is those.

⚠ Positions go through the registered Vector3 converter, which writes at round-trip precision. Doc 24's P1 says the scene format is where this phase can go wrong quietly: a vertex list written at whatever float.ToString gives makes every scene a merge conflict with itself, because a file saved, opened and saved again would not be the same bytes. The format already solved this for a transform; a mesh is the first thing in a scene that is not a handful of scalars, and it gets the same answer for free by being made of Vector3s.

⚠ Corner counts rather than start offsets. A start offset is derivable from the counts and is not derivable the other way round without trusting that the file is consistent — so writing the counts means a hand-edited file that has lost a line is a short mesh rather than one whose last face reads off the end of the corner list.

Fields and properties (6)

  • public List<Vector3> Positions

    The shared positions.

  • public List<int> Corners

    A position index per corner, in face order.

  • public List<int> Faces

    How many corners each face has.

  • public List<int> Groups

    Which group each face is in.

  • public List<int> Smoothing

    Which smoothing group each face is in, or empty when every edge is hard.

  • public List<Vector2> TexCoords

    A texture coordinate per corner, or empty when the mesh has never been mapped.

Used by (5)

  • BlockoutGeometryTestsVixen.Editor.Blockout.Tests
  • EditMeshSceneTestsVixen.Editor.SceneView.Tests
  • EditMeshesVixen.Editor.SceneView
  • SceneEntityDataVixen.Editor.Core
  • TypeRegistrationVixen.Editor.Core