Vixen
dd8b0a81
csharp
public record class SkinBinding

Skinning weights for a whole mesh, as a flat block with a fixed stride.

Read the guide page for this →

Remarks

EditMesh has no weight channel, so the transfer returns one alongside the mesh rather than inside it. That is the choice docs/plan/41-automatic-retopology.md § D12 leaves open and it is made here: parallel arrays, indexed by the mesh's own position indices, so a caller holds the mesh and the binding together and neither one knows about the other. Adding a channel to the mesh kernel instead would put a rig's vocabulary into doc 24's geometry types, which have four consumers that have never heard of a bone.

⚠ Per position, not per corner — unlike normals and texture coordinates. A seam is two corners at one position carrying different coordinates, which is a statement about the surface's parameterisation. A weight is a statement about where the surface goes, and two corners at one position that moved differently would tear the mesh.

⚠ Flat with a stride rather than jagged, because a jagged array is a heap allocation per vertex and because the stride is the influence limit a target declares. Unused slots are (0, 0) and a reader stops at the first zero weight — every producer here sorts by descending weight, so the zeros are always at the end.

Fields and properties (3)

  • public required IReadOnlyList<SkinInfluence> Influences

    Every influence, Stride of them per vertex, in vertex order.

  • public required int Stride

    How many influences each vertex has room for. Four is the usual answer.

  • public int VertexCount

    How many vertices the block covers.

Methods (2)

  • public IEnumerable<SkinInfluence> At(int vertex)

    One vertex's influences, including the zero-weight padding.

  • public float Total(int vertex)

    What one vertex's weights add up to.

Used by (7)

  • AttributeMirrorVixen.Geometry.Remeshing
  • AttributeTransferVixen.Geometry.Remeshing
  • AttributeTransferTestsVixen.Geometry.Remeshing.Tests
  • SourceAttributesVixen.Geometry.Remeshing
  • SymmetryTransferTestsVixen.Geometry.Remeshing.Tests
  • TransferFixturesVixen.Geometry.Remeshing.Tests
  • TransferResultVixen.Geometry.Remeshing