Skip to content

Skel: Slice I — Envelope weight assignment + falloff (radius-based auto-skinning v2) #563

@fernandotonon

Description

@fernandotonon

Parent epic: #554
Stretch. Do not pick up until Slices A–F land.

Goal

A radius-based envelope skinning model alongside the weight-paint approach (#558) and the AI biharmonic auto-weights (#402). Envelopes are the classic Maya/Houdini "every bone has a tubular influence; vertices inside it weight to that bone with smooth falloff" model. Cheap, predictable, and great as a starting point that the weight brush refines.

Scope

  • Per-bone envelope params:
    • head_radius, tail_radius — inner zone where weight is 100%.
    • outer_radius — outer zone where weight falls off to 0 along a configurable curve.
    • Falloff curve — linear / smooth / configurable Bezier.
  • Compute envelope weights:
    • For each vertex, compute distance to every bone's "capsule" (the swept-radius along the bone's axis).
    • Weight = 1.0 inside inner, 0.0 outside outer, smoothly interpolated between.
    • Normalize across all contributing bones.
    • Optional "weight only to nearest N bones" cap (default 4 — game-engine constraint).
  • Modes:
    • Envelope-only: weights are read from envelopes, no hand-painted weights.
    • Envelope + paint: envelopes provide the base; painted strokes (Slice D) override locally. "Reset to envelope" button resets a stroke region.
  • Visualization: render the inner + outer capsules as translucent overlays in the viewport when envelopes are enabled.
  • Compare with:
  • Operations:
    • "Auto-fit envelope to mesh" — for each bone, compute the envelope radii from the local mesh diameter around the bone.
    • "Apply envelopes to weights" — bake the envelope-computed weights into the actual VertexBoneAssignments (after which the user can switch off envelope mode and continue with weight paint).

Acceptance Criteria

  • Auto-fit envelope produces sensible radii on a humanoid fixture.
  • Vertices deform correctly under envelope skinning when posed.
  • Envelope + paint mode: painted overrides survive subsequent envelope recomputes (envelopes only fill un-painted regions).
  • "Apply to weights" bakes correctly and the result matches the live envelope-driven deformation.
  • Inner / outer capsules visualised correctly.
  • All operations undoable.
  • Sentry breadcrumbs scene.skel.envelope.*.
  • Headless-CI tests cover envelope-weight computation on a 3-bone fixture.

Effort

~9 days.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requestedskeletonSkeleton & rigging: bones, weights, IK, constraints, envelopes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions