Skip to content

Anim: Slice A — Morph targets / blend shapes (import, preview, edit, export) #518

@fernandotonon

Description

@fernandotonon

Parent epic: #517

Goal

First-class support for morph targets / blend shapes — the per-vertex deltas that drive facial animation and character expressions. Authors create / edit weights, preview, and round-trip through FBX and glTF.

Why

Every modern game engine consumes blend shapes. QtMeshEditor currently drops them on import — there is no MorphAnimationTrack or Pose usage in src/. Users can't author or even preview facial animation today.

Scope

  • Importer: extend MeshImporterExporter to detect FBX blend shapes and glTF morph targets. Convert to Ogre::Pose + Ogre::MorphAnimationTrack (Ogre 14.5 supports both — we just don't use them).
  • MorphAnimationManager singleton (src/MorphAnimationManager.{h,cpp}) — owns per-entity morph state, emits morphTargetsChanged, morphWeightChanged.
  • Inspector "Morph Targets" section under Animation Mode:
    • List of named morph targets with weight sliders (0–1, optionally -1..1 for "shape minus base").
    • Search/filter by name (characters often have 50+ targets).
    • Multi-edit: select multiple targets and apply a common value.
    • Reset all / lock targets.
  • Dope sheet integration: morph-weight tracks appear in the dope sheet alongside bone tracks; keyframable on the slider.
  • Curve editor integration: morph weight curves edit just like bone TRS curves.
  • Authoring (basic v1):
    • Save the current edit-mode vertex positions as a new morph target relative to the base mesh.
    • Rename / delete morph targets.
    • Live preview: scrubbing weights updates the mesh in-viewport.
  • Exporter: FBX (existing FBXExporter) and glTF write morph targets.
  • CLI: qtmesh morph model.fbx --list [--json], qtmesh morph model.fbx --set <name>=<weight> -o out.fbx.
  • MCP: list_morph_targets, set_morph_weight, add_morph_target, delete_morph_target.

Acceptance Criteria

  • Importing an FBX or glTF with blend shapes produces visible, named morph targets the user can preview.
  • Weight sliders update the mesh in real time.
  • Dope sheet and curve editor show and edit morph-weight tracks.
  • User can author a new morph target from an edit-mode mesh delta.
  • Export round-trip preserves all morph targets and their animation tracks for at least FBX and glTF.
  • All operations are undoable.
  • Headless-CI-safe unit tests cover import, weight set, and round-trip.
  • Sentry breadcrumbs scene.anim.morph.* recorded.

Effort

~10 days.

Metadata

Metadata

Assignees

No one assigned

    Labels

    animationAnimation systems: skeletal, morph, pose, VAT, alembic, proceduralenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions