/game-assets:humanoid-motionfrom game-assets
Generates humanoid animations from two-camera video mocap with foot lock, loop cutting, and gating. Useful for animating contract-rigged characters from filmed performances.
Ships in game-assets. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
A clip here starts as one video in which a front and a side view of the character perform the
move together, and ends as an action on the humanoid contract skeleton
(blender-retarget → reference/humanoid-contract.md), so every contract character plays
it unchanged. The front half solves the motion straight onto the character's own rig; the back
half cleans, gates and ships it.
| Symptom | Go to |
|---|---|
| "Turn this move into an animation"; two-camera mocap; which source (video or a pack) | Which source; reference/two-camera.md, then reference/pipeline.md |
| The halves of the H3 take play out of step, colours swap, a limb vanishes | reroll the seed (reference/two-camera.md, Limits) |
reader.val_mean_px fails; train the reader | reference/two-camera.md (Reader) |
two_view_agreement fails | reference/two-camera.md (Gates): the views were animated differently; reroll |
"The solve pops": pops in the solve; pops_in_source | reference/pipeline.md §4 |
| Jitter on a clean overlay | raise solve.py --acc-weight (reference/two-camera.md, Fit) |
| "Feet slide", "lock the feet"; no plant found | twocam.py bake; reference/pipeline.md §2 (--rig-info) |
plant_coverage_min fails; a walk filmed in place | --state walk at capture or bake; reference/two-camera.md (A walk in place) |
reach_m or contact_height_m fails | reference/pipeline.md §4 |
| Where to cut the walk loop; the loop pops at the seam | twocam.py loop; reference/pipeline.md §2 |
| A character holds a prop in the move | reference/two-camera.md (A held prop) |
| Take the travel out of a clip that has it | blender-retarget (in place) |
| Fingers flat or wrong | reference/hands.md |
| Can this clip be sold in the EU? | reference/pipeline.md §3; art-asset-registry → reference/licences.md |
The solve is raw material, never the clip. Each stage has a gate that can fail, and a take that fails is re-rolled, re-filmed or trimmed, not hand-repaired. Nothing here retimes a clip or paints a pose.
| The move | Source | Read |
|---|---|---|
| Any move for a contract-rigged character: walk, run, idle, a strike, a leap no actor can do, a Q-version body | two cameras: front + side reference → local H3 video → per-character reader → two-view triangulation → fitted to the rig, no retarget | reference/two-camera.md |
| A clip pack already has it | a pack, retargeted (in place or with translation) | blender-retarget |
scripts/twocam/twocam.pyOne cross-platform runner, one subcommand per stage, files under runs/<character>/. Blender comes
from --blender or the BLENDER environment variable (default blender on the PATH). Exit codes:
0 pass, 2 a gate failed (the runner carries on, so the overlay, the fit and the GLB are there to
look at), 1 refused input or an error (it stops).
| # | Subcommand | Once per | Writes | Look at before the next |
|---|---|---|---|---|
| 1 | prepare (a held prop: --prop OBJECT) | character | rig/rig_info.json, rig/twocam.blend (the painted copy) | the solved bones and feet it lists |
| 2 | ref | character | ref/ref.png, the first frame | ref.inside_frame, ref.on_ground |
| 3 | film | move | videos/<move>/s<seed>/h3.mp4, film.json (its licence) | the H3 take itself: both halves in step, colours unswapped. A bad take is rerolled here, before an hour of training |
| 4 | dataset | character | dataset/ | dataset.in_view, dataset.written |
| 5 | train | character (CUDA) | reader.pt: 20 epochs, or 12 with --init for the next character on about 1,000 new samples | reader.val_mean_px |
| 6 | capture (a walk or run: --state walk|run) | move | clips/<name>/: detect → solve.py --samples-out (despike on) → motion_metrics samples.json --pops-min-move 0.03, on a walk or run with --travel-mps auto → apply_motion --glb | overlay.mp4, two_view_agreement, pops; exit 2 on foot_slide_* is expected, bake locks the feet |
| 7 | prop (a held prop, after capture) | move with a prop | prop_track.py (prop_track.json, prop_overlay.mp4) → solve.py --prop-track → metrics → GLB; the free fit kept as *_noprop.* | the overlay on the prop, prop.axis_error_*, prop.hand_shift_px (reference/two-camera.md, A held prop) |
| 8 | bake (state from capture, or --state) | move | apply_motion --save keyed.blend → contact_bake.py in Blender, --legs contract --rig-info rig_info.json (its contract_names find an Auto-Rig Pro rig's bones) --readings samples.json, on a walk or run --travel-mps auto → motion_metrics on the baked samples; --render: baked.mp4, front | side | slide, plant_coverage_min, reach_m, contact_height_m, pops and jitter (what the video has is discounted: pops_in_source, jitter_over_source_mps2) |
| 9 | loop | walk or run | motion_metrics --loop --pops-min-move 0.03 (loop.json) → contact_bake.py --sample-only --loop-report (cut.npz, loop.blend) → motion_metrics on the cut (cut_metrics.json) | loop_period_found, loop_seam_ratio, the cut's slide; a failed search stops before the cut |
The prompt for film comes from make_prompt.py (one action sentence per clip). Training does not
run on a Mac; read and fit do. The stages, the frame, the reader, the fit and their gates:
reference/two-camera.md.
| # | Stage | Run | Gate |
|---|---|---|---|
| 1 | Contact bake | twocam.py bake, or blender -b keyed.blend -P contact_bake.py -- --armature RIG --action ACT --legs contract --rig-info rig_info.json --out baked.blend --samples-out S.npz (a walk or run: --travel-mps auto) | exit 0: slide p95 ≤ 1.5 cm, max ≤ 3 cm, reach_m, contact_height_m |
| 2 | Loop cut | twocam.py loop, or motion_metrics.py S.npz --state walk --loop --pops-min-move 0.03 --out loop.json, then contact_bake.py ... --sample-only --loop-report loop.json --out loop.blend on the cut | loop_period_found, loop_periodicity, loop_seam_ratio |
| 3 | Gate | motion_metrics.py CUT.npz --state walk --pops-min-move 0.03 (no --loop: one period, its seam gated in 2) | exit 0 |
| 4 | FBX | blender-character-rig bcr_fbx snapshot → export → reimport, rig_gate.py | rig_gate.py exit 0 |
| 5 | Unity | unity-rigged-character SharedSkeletonClipImporter.cs, RootBonePath = <rig>/Root/Hips | every binding resolves on every contract character |
| 6 | Record | art-asset-registry: the video with its licence, then the clip with --link depends-on=<the video> | registry.py check exit 0 |
Commands in full, the runner's walk worked through, and what each failure means:
reference/pipeline.md.
| Path | Role |
|---|---|
scripts/twocam/twocam.py | the runner: prepare, ref, film, dataset, train, capture, prop, bake, loop; exit 0/2/1 |
scripts/twocam/ | the stages it calls (layout, skeleton, prompt, film, reader, detect, solve, exam, Blender scripts): reference/two-camera.md |
scripts/twocam/prop_track.py | a held prop's 3D direction from the two views, for solve.py --prop-track; prop.track_* gates, overlay; exit 0/2/1 |
scripts/contact_bake.py | host (BVH) or Blender (action): plants from contact probabilities or the shared plant detector, sole heights from --rig-info or a samples file's sole_offsets (rig bone names through its contract_names), --readings carried into the samples, foot point locked per plant (in the belt frame with --travel-mps), analytic two-bone leg IK, slide before/after through motion_metrics; --sample-only measures, --loop-report samples and saves the cut; exit 0/2/1 |
scripts/bvh_io.py | BVH read/write/FK and Euler conversions for contact_bake.py's host mode |
reference/two-camera.md | the front half: the frame, the skeleton, the stages, the reader, the fit, the gates, the exam |
reference/pipeline.md | the back half: commands, the ledger records, failures and fixes |
reference/hands.md | the fixed hand poses a clip ships with |
S=<skills>/humanoid-motion/scripts
python3 $S/bvh_io.py --selftest && python3 $S/contact_bake.py --selftest
blender -b --factory-startup -P $S/contact_bake.py -- --selftest-blender
contact_bake.py imports motion_metrics.py from <skills>/blender-retarget/scripts (the one plant
definition); keep the two skills side by side. It needs numpy only; the reader and the fit need
torch (reference/two-camera.md).
Root stays at rest until root
motion is split off downstream. A walk filmed in place has none to split: its speed is
travel_mps.--state walk measures that speed and locks the
feet in the belt frame; plant_coverage_min catches a walk whose feet were not planted.sole_offsets), and the bake and the gate read the
same plant.motion_metrics reports a spike the two-view
readings also show as pops_in_source, not gated; only a spike the fit added counts in pops.
Both count one event per frame and joint, so a twist bone beside the shin is not a second pop.
Jitter is gated over 1.2 x the readings' on the same frames; unread fingers take their hand's.
solve.py --despike replaces a one- or two-frame pop the fit added with a slerp of its neighbours
and lists what it changed.reference/hands.md).licence; the clip links to it with
depends-on, so a local H3 video's exclusion (minimax-h3-local: US, EU, UK, KR) reaches every
clip solved from it.character-autorig (Auto-Rig Pro), or
blender-character-rig by hand.k, in place, the bake-off):
blender-retarget.comfyui-asset-generation.sprite-from-video.Outputs here are engine-neutral files; the engine plugin today is unity-dev:
SharedSkeletonClipImporter.cs), Avatars and masks: unity-rigged-characterunity-animationreference/hands.md (opens in a new tab)reference/pipeline.md (opens in a new tab)reference/two-camera.md (opens in a new tab)scripts/bvh_io.py (opens in a new tab)scripts/contact_bake.py (opens in a new tab)scripts/twocam/blender/apply_motion.py (opens in a new tab)scripts/twocam/blender/bcommon.py (opens in a new tab)scripts/twocam/blender/prepare_rig.py (opens in a new tab)scripts/twocam/blender/render_baked.py (opens in a new tab)scripts/twocam/blender/render_dataset.py (opens in a new tab)scripts/twocam/blender/render_ref.py (opens in a new tab)scripts/twocam/detect.py (opens in a new tab)scripts/twocam/exam.py (opens in a new tab)scripts/twocam/film.py (opens in a new tab)scripts/twocam/layout.py (opens in a new tab)scripts/twocam/make_prompt.py (opens in a new tab)scripts/twocam/model.py (opens in a new tab)scripts/twocam/prop_track.py (opens in a new tab)scripts/twocam/skeleton.py (opens in a new tab)scripts/twocam/solve.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub tipoli5890/game-studio --plugin game-assets10 skills in this plugin
/art-asset-registryTrack generated 2D/3D assets in one ledger: which prompt made each file, approvals, what's stale./blender-character-rigHand-built Blender rig, fallback to the default character-autorig: mascot bodies, pack-skeleton fit./blender-retargetPut stock or purchased clips on a rigged character in Blender: retarget, clip library, weight repair./character-autorigRig a humanoid with a licensed Auto-Rig Pro in one command: its AI plus mesh markers, gates./codex-visualGenerate 2D art in one locked style: sprites, icons, pixel-art tilesets, sheets, breathing idles./comfyui-asset-generationGenerate BGM, sound effects, video, or a 3D model from an image on a self-hosted ComfyUI server.