Skip to content

Skel: Slice H — Bone constraints authoring (look-at / copy-rotation / parent-of / limit-rotation) #562

@fernandotonon

Description

@fernandotonon

Parent epic: #554
Coordinated with: #525 (Anim epic's constraint slice).

Goal

Bone-level constraints — the rigger's bread and butter outside of IK. Look-at (head tracking a target), copy-rotation (mirror another bone), parent-of (independent transform parenting), limit-rotation (clamp Euler ranges).

This slice owns the authoring UI and bone-level wiring; #525 owns the per-frame evaluation plumbing that runs constraints during playback. The split is intentional — bones own their constraint lists (this epic); the animation system owns "evaluate the constraint stack each frame" (the Anim epic). Both must coordinate scope before either lands.

Scope

  • Constraint types in this slice:
    • Look-at / Aim — bone rotates to point at a target.
    • Copy-rotation — bone copies another bone's rotation (full, or per-axis subset).
    • Copy-position — bone copies another bone's world/local position.
    • Parent-of — bone inherits transform from a non-hierarchical "parent" target (used for "weapon parented to hand" without changing the rig hierarchy).
    • Limit-rotation — clamp Euler ranges per axis (knees don't bend backwards).
  • Constraint stack per bone: ordered, evaluated top-to-bottom after the animation track is sampled. Each constraint has:
    • Influence weight 0..1.
    • Target bone or scene node.
    • Per-type parameters (axis selection, limit values, etc.).
    • Mute toggle.
    • Reorder via drag.
  • UI: a "Constraints" inspector subsection per selected bone. Add / remove / reorder / mute / rename.
  • Bake-to-keyframes: same pattern as the Anim epic's Anim: Slice H — Constraints (look-at, IK targets, parent-of, copy-rotation) #525 — flatten constrained motion to a baked FK clip for engine export.
  • Round-trip: store constraints in the project file + glTF extras. FBX has its own constraint model but is lossy via Assimp's open-source path; document the lossy fields up front.
  • Live evaluation: integrates with the animation evaluation step. Constraint evaluation runs after the IK solver (Slice F) so an IK-driven bone can be further look-at-constrained on top.

Acceptance Criteria

  • Each constraint type behaves correctly on a fixture (head look-at follows a moving target; 2-bone copy-rotation mirrors).
  • Constraint stack ordering produces predictable results when constraints conflict.
  • Bake-to-keyframes flattens constrained motion cleanly into the source animation.
  • Project save/load + glTF extras preserve constraints.
  • Export prompts user about baking when constraints exist on bones referenced by the exported skeleton.
  • All operations undoable.
  • Sentry breadcrumbs scene.skel.constraint.*.
  • Headless-CI tests for each constraint type on fixture skeletons.
  • Coordination with Anim: Slice H — Constraints (look-at, IK targets, parent-of, copy-rotation) #525: the same evaluation plumbing is shared; both slices must agree on the data model before either merges.

Effort

~12 days, plus coordination time with #525.

Open question

Does this slice land before or after #525? Recommended sequence: this slice's data model lands first (smaller surface area; just bone authoring), then #525 wires it into per-frame evaluation. Confirm at scoping.

Metadata

Metadata

Assignees

No one assigned

    Labels

    animationAnimation systems: skeletal, morph, pose, VAT, alembic, proceduralenhancementNew feature or requestskeletonSkeleton & rigging: bones, weights, IK, constraints, envelopes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions