Skip to content

Skel: Slice B — Bone hierarchy editing (reparent / detach / attach / split / connect) #556

@fernandotonon

Description

@fernandotonon

Parent epic: #554
Depends on: Slice A (#555)

Goal

Beyond create/remove, riggers need to reshape the bone graph: reparent a chain to a different parent, detach a chain to root, attach a chain to another entity's skeleton (the user explicitly asked about this), split a long bone in two, connect/disconnect bones from their parent's tail.

Scope

  • Reparent: drag a bone to a new parent in the outliner, or right-click → "Set parent…". Children of the reparented bone follow.
    • Transform mode: pick "keep world position" (default, recomputes local TRS) or "keep local position" (TRS unchanged, parent change only).
  • Detach: lift a bone (and its children) to be a child of the skeleton root.
  • Attach to entity's skeleton:
    • Source: selected bones in entity A.
    • Target: entity B (must have a skeleton; one is created if absent).
    • Copies the bones into B's skeleton, preserving names (with collision-resolution rules: rename source TailTail.001 if B already has Tail).
    • Copies the corresponding VertexBoneAssignments only if the user also selects the geometry to transfer. By default, attach is rig-only — the source bones move to entity B but the source mesh stays bound to entity A. Useful for adding a "weapon socket" bone to a character.
  • Split bone: insert a new bone halfway down an existing one (or at a custom position along the bone's axis). Original bone becomes the parent, new bone is the child. Weight redistribution: linearly interpolated based on the split position.
  • Connect / disconnect: toggle whether a bone's head coincides with its parent's tail (Blender convention).
  • Mirror chain: duplicate a selected chain across an axis with _l/_r naming convention (depends on Slice E's naming-detection plumbing — coordinate; if Slice E hasn't landed, ship "duplicate without rename").
  • Undo: new commands ReparentBoneCommand, AttachBoneToEntityCommand, SplitBoneCommand, ConnectBoneCommand. Each preserves the previous skeleton state for full revert.
  • MeshImporterExporter round-trip: hierarchy changes survive glTF / FBX export.

Acceptance Criteria

  • Reparent in "keep world" mode visually moves the bone to its new parent with the same world transform.
  • Reparent in "keep local" mode preserves the local TRS exactly.
  • Detach moves a chain to root without breaking weight bindings.
  • Attach-to-entity copies a "socket" bone from character A onto character B with the bone visible in B's outliner and gizmo controllable.
  • Split bone produces two bones along the original axis with smooth weight interpolation.
  • Connect / disconnect toggles head-tail coincidence correctly.
  • Hierarchy changes round-trip through glTF (and FBX where possible).
  • Every operation is undoable.
  • Sentry breadcrumbs scene.skel.hier.* per op.
  • Headless-CI tests for reparent (both modes), attach-to-entity, and split.

Effort

~10 days. Attach-to-entity is the trickiest; cross-entity skeleton manipulation has edge cases on every existing entity referencing the source skeleton.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew 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