Skip to content

M3 IK and constraints: two-bone with limits, FABRIK, full-body IK, foot placement, aim, hand IK (L3) #857

Description

@nicolas-maman

Part of #853. L3: IK and constraints.

Build:

  • rig: two-bone IK with joint limits, soft reach and twist distribution (the solver from ik; motion's private copy goes).
  • FABRIK chains (spine, tails).
  • Full-body IK with effector weights.
  • Foot placement from contact markers: pelvis offset, foot lock, toe and heel, slopes and stairs. One foot system, replacing today's four.
  • Look and aim constraints over several bones (lookat's job).
  • Hand IK on props: a bowl in both hands, a rifle with two hands.

Demo: walking up stairs and slopes, aiming a rifle with both hands, carrying a bowl while walking.

Held to:

  • soles within 1 cm of the ground and under 5 mm into it, on 0.2 m stairs and 20 degree slopes;
  • no knee or elbow past its limit;
  • a hand on its grip within 5 mm.

Folds in #700 (a reach across the trunk) and the hand half of #842.

Activity

  1. nicolas-maman commented on Nov 1, 2026

    @nicolas-maman
    CollaboratorAuthor

    Reopened: #891's merge (6fda12b) closed this before its list was met. The remaining work is below, with the closed issues it absorbs.

    On main, with its numbers (test_ik_constraints, test_anim_pipeline)

    • Two-bone IK with limits: a knee bends 133° at most, an elbow 150°, and no knee bends behind straight (0 mm).
    • Twist shared into the forearm: the wrist takes 44° of a 90° turn.
    • FABRIK: off its point by 0.51 mm. Whole-body reach: the hand within 10⁻⁶ mm, the feet held.
    • Look and aim: the head within 2° of its point, a rifle's barrel 0.10° off its target, the hands within 0.002 mm of their grips.
    • Feet on any ground: a sole sinks at most 0.94 mm into 0.2 m stairs and 0.008 mm into a 20° ramp.
    • Stride warping to a tread.
    • Turning on the spot in steps: no foot crosses the hips' middle, each step lifts its foot 60 mm.

    Missing

    • One foot system. ae3d.feet, motion's own feet and ae3d.lookat still run beside ikrig. Retire them onto it (with M6 migration onto the animation pipeline; old writers retired #860).
    • motion: a hand reaching across the body stops short; the two-bone reach doesn't route the forearm around the trunk #700, a reach across the trunk (closed by the merge). The physical figure's forearm rests on its chest 22 cm short of a wound on the other arm. Swinging the elbow clear of the trunk got it to 19 cm, but turned the arm at 26 rad/s against its clip's 14, so it was reverted. A route that keeps the arm's speed is still to find.
    • Feet land across stair edges: place footsteps onto treads #897, footsteps onto treads (closed by the merge). A foot lands where the stride puts it, sometimes across a tread's edge. Place each footstep on a tread.
    • Legs and shoulders that read wrong in the showcase: the female's idle, the sprint's shoulders #898, what still reads wrong in the showcase (closed by the merge). Measured with AE3D_METRICS=1 AE3D_TICK=60 (AE3D_TICK is in hertz):
      • The figure on a stick turns at 14 s and 38 s while its stop's clip still has a foot in the air. Steps for a turn wait for both feet down, so the body spins over a clip that is still stepping: a knee goes 51° out and a foot 7.8 cm past the hips' middle. It needs a rule: turn the stop's last steps toward the new heading, or hold the turn until the feet are down.
      • As the stick's pistol aim fades during its turn, the right forearm comes up to the face (21.57 s).
      • The female's retargeted idle turns a foot in, with a knee 41 to 45° out off the hips. It is already 42° with the feet IK off, so it comes mostly from the retarget of the idle.
      • The authored sprint turns the chest 49° off the hips; people counter-rotate 15 to 25°.
      • A forearm rolls up to 51° off its upper arm (the stick).
      • The showcase's per-figure bounds are not in CI: no knee more than 30° out where it is bent 6 cm off its line, the chest within 30° of the hips at a run, the legs never closer than 8 cm.
    • The captured walker drifts off its line: 4 cm, then 58 cm over 15 out-and-backs #900, the captured walker's drift (closed by the merge): 4 cm off its line, then 58 cm over 15 out-and-backs.
    • Ramps at a full stride. At the walk's own stride on a 20° ramp, the trailing toe stands 16 mm off the slope at push-off. The test walks it at 0.7 of the stride.

    Done when there is one foot system and each item above is met, measured in test_ik_constraints or test_anim_pipeline.

  2. nicolas-maman commented on Nov 2, 2026

    @nicolas-maman
    CollaboratorAuthor

    Reopened: #905's merge (68934a3) closed this, but it carried only the hand-off between writers (animator.pause, resume, share_take, safe behaviour removal). The remaining work is as written above.

  3. nicolas-maman commented on Nov 2, 2026

    @nicolas-maman
    CollaboratorAuthor

    The showcase measured with ae3d.metrics (#854): every figure, the worst a player would see over its first 10 s, on the pose drawn. Toe skating is a planted toe's slide a stance (bound 5 mm); sinking is a sole into the ground.

    Figure Before (f487667) Now What it was
    The runner 0.25 mm 0.23 to 0.28 mm
    The female, stopped by a cut to her idle 596 mm 2.95 to 3.07 mm a planted foot slid into the idle's stance; now it steps there
    The hit figure on its block sole 120 mm into the block 0 mm its feet eased onto the block over its first 0.3 s; now they stand on it from the first frame
    The captured walker 363 mm 354 to 365 mm open: its turnaround cuts the forward walk to the backward walk; needs matching (#906)
    The figure on a stick 26 mm 22 to 31 mm open: a locked foot dragged just after heel strike, mid-walk in its 2D blend
    The climber 0.10 mm 0.11 to 0.14 mm
    The rifleman, turning to aim 16 mm 2.4 to 3.4 mm steps turned the foot while its toe was still down

    Four runs each for "Now"; the range is frame timing.

    What changed in ikrig:

    • Feet that step step only while the figure stands, so a figure can walk, stop and turn with steps on.
    • A step rises before it travels and turns as it travels. It lifts higher the longer it is, keeps a toe lock while it rises, and lands into a lock on its own heading.
    • feet_stand: feet put on a figure before its first frame stand on the ground at once.

    Still to do here:

    • the walker's turnaround;
    • the stick's drag after heel strike, which is the same graph as Siltreach's pacer: they measure 46 mm cruising;
    • the knees, 42 degrees out off the hips' facing standing and walking on several figures, to look at and judge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions