public readonly record struct SceneShapeWhat a run of entities draws: a built-in shape, or a mesh an artist authored.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
One key for two things, because a batch is a batch either way. The viewport groups entities that share geometry into one instanced draw, and whether that geometry came out of MeshPrimitives or out of a bundle changes nothing about the grouping, the instancing or the pipeline. What it changes is where the vertices come from, which is Shape's business alone.
⚠ A PrimitiveKind of zero is Cube, so the discriminator has to be the reference and not the kind. Defaulting a key would otherwise mean "every entity is a cube", which is a viewport full of cubes where the meshes should be — and the meshes are exactly what nobody had yet, so it would have looked like the feature simply not working.
Fields and properties (7)
public PrimitiveKind KindWhich primitive, when this names one.
public AssetReference MeshWhich mesh asset, when it names one instead.
public Entity OwnerWhose edited mesh, when it names one of those.
public int VersionWhich revision of that mesh — see SceneDocument.MeshVersion.
public int GroupWhich face group of it, or −1 for the whole mesh.
public bool IsAssetWhether this names an authored mesh rather than a built-in shape.
public bool IsEditWhether this names one entity's own edited geometry.
Methods (4)
public SceneShape(PrimitiveKind Kind, AssetReference Mesh, Entity Owner = default(Entity), int Version = 0, int Group = -1)What a run of entities draws: a built-in shape, or a mesh an artist authored.
public static SceneShape Of(PrimitiveKind kind)A key for a built-in shape.
public static SceneShape Of(AssetReference mesh)A key for an authored mesh.
public static SceneShape Of(Entity owner, int version, int group = -1)A key for one entity's edited mesh, at one revision of it.
Used by (5)
- BlockoutSurfaceTestsVixen.Editor.Blockout.Tests
- SceneMeshAssetTestsVixen.Editor.SceneView.Tests
- SceneMeshesVixen.Editor.SceneView
- ScenePresenterVixen.Editor.App
- ShapeBatchVixen.Editor.SceneView