Skip to content

3.48.0

Choose a tag to compare

@fernandotonon fernandotonon released this 03 Oct 21:00

Animation constraints (#525)

Make a bone or scene node follow another object every frame, on top of its animation, then bake the result into keyframes.

  • Constraint types:
    • Look at: points the aim axis at the target. The aim axis defaults to −Z, the forward direction for Ogre cameras and lights.
    • IK (2-bone): put it on a hand or foot and the two bones above it bend so the hand or foot reaches the target. An optional pole object sets which way the joint bends.
    • Child of: follows the target as if parented to it, without changing the scene hierarchy.
    • Copy rotation / Copy position: copy the target's rotation or position. Copy position can be limited to chosen axes.
    • Limit rotation: clamps the rotation angles per axis, e.g. so knees don't bend backwards.
  • Influence: every constraint has an influence from 0 to 1.
  • Stacks: each bone or node can hold several constraints. When they conflict, the top one wins. You can mute, reorder, and remove constraints; each change is one undo step.
  • Bake: writes the motion into keyframes, including the bones an IK bends; node motion goes into a node clip. Then it mutes the baked constraints. A bake that can't complete changes nothing.
  • Export: constraints can't be stored in glTF/FBX. Export offers Bake & Export, Export without baking, or Cancel.
  • Saving: constraints are saved in a <file>.constraints.json sidecar and reloaded with the asset.
  • Where to find it:
    • Inspector: Animation mode → Mode Tools → Constraints.
    • CLI: qtmesh anim <file> --list-constraints, and --constraint <type> --owner <ref> --target <ref> --bake-constraints.
    • MCP: list_constraints, add_constraint, set_constraint, move_constraint, remove_constraint, bake_constraints.
  • Docs: docs/ANIM_CONSTRAINTS.md.
qtmesh anim hero.fbx --constraint ik --owner "bone:*/mixamorig:LeftHand" --target "node:Cup" \
                     --constraint limit-rotation --owner "bone:*/mixamorig:LeftForeArm" --max-y 10 \
                     --bake-constraints --animation Idle -o hero_cup.glb

Full changelog: 3.47.0...3.48.0