Skip to content
Back to skills

Animal

ASecurity

**Use for**: a horse, pony, donkey, deer or any four-legged animal as the hero or as the team pulling a cart, coach or sled: a static GLB (generated or downloaded) rigged in Blender, its gait driven by the scene's document at the speed of the ride. **Status**: the rig and the gait are verified in Play on a horse pair pulling a coach on a moving road (0.0 mm hoof slip, no frame-time cost); on the treadmill of an endless scene the hook below follows the solver's contract (it only sees the world...

  • 21 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added December 1, 2026
ai-agentspythonnode

Works with

  • cli

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add josazar/skill-endless-scene --skill animal --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Animal?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Animal
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/josazar-animal/badge)](https://www.skillsdirectory.com/skills/josazar-animal)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
<!-- sub-skill of endless-scene: read ../../SKILL.md first (shared rules, build order) -->
# Sub-skill: animal (a rigged four-legged hero that walks, trots and gallops)

**Use for**: a horse, pony, donkey, deer or any four-legged animal as the hero or as the team pulling a cart, coach
or sled: a static GLB (generated or downloaded) rigged in Blender, its gait driven by the scene's document at the
speed of the ride. **Status**: the rig and the gait are verified in Play on a horse pair pulling a coach on a moving
road (0.0 mm hoof slip, no frame-time cost); on the treadmill of an endless scene the hook below follows the
solver's contract (it only sees the world pose), not yet seen in Play.
Needs Blender 4.2 or later (run headless), Python 3 with Pillow, and esbuild (`npx esbuild`) for `build_block.py`;
the offline check (`node scripts/check.mjs`) needs Node only.

## On the treadmill

The world flows past and the animal stays put, but the solver locks each hoof on the ground, so it must be told
where the animal would be if it really travelled. In `gaitStep(dt, place)` (below, and `references/document.md`):

1. **`local` is the fixed spot**: the animal group's position in its parent (the hero stage, or the road's
   `Vehicle Anchor`) and its yaw in degrees. The GLB's head points +x: yaw 0 on the road (+X to the nose), 90 on a
   ride (the hero faces -z).
2. **`world` is the distance ridden**, from the scene's one clock (shared rule 3), never a separate integration:
   on a ride `{ x: lateral, z: -distance, yaw: PI / 2 }`, on a straight road `{ x: distance, z: lateral, yaw: 0 }`,
   in scene units. In bends, integrate x and z from the same heading the road turns by; the solver side-steps when
   the turn drags the animal sideways. Forward is `(cos yaw, 0, -sin yaw)`.
3. **The ground must scroll by exactly that distance under the hooves**: the road strip's shader and the bank pieces
   read the same `distance`. A different speed for the ground shows as hooves sliding while the solver reports 0.
4. **A rush changes the gait by itself**: walk, trot and gallop blend by speed from the speed table. Keep the
   table's top speed within the gallop's range (11 m/s on a 1.6 m horse) or the stride runs out of reach.
5. **Frozen captures**: pass `dt = 0` when the clock is frozen (`KIT_FREEZE`): the animal holds its last pose. The
   pose depends on the ride so far, so freeze after the same run-up each time to compare captures.
6. **One document**: merge the gait block into the scene's single document in its own scope, keep its load check
   and its integrity line, and call `gaitStep` from the same frame callback that advances the clock.

<!-- end of sub-skill header: below is synced from the standalone glb-gait-rig skill, edit it there -->


A static four-legged GLB (from an image-to-3D generator or a library) becomes a character that walks, trots and
gallops at the speed it is moved, with no hoof sliding. Blender only builds the skeleton and the weights; the motion is
a procedural solver in the scene's HTML-content document, so it adapts to any speed, turn or stop instead of looping
baked clips. Proven on a coach horse pair (35 bones, 2 x 385 KB GLBs, 0.0 mm hoof slip, no frame-time cost).

**The one idea**: each hoof is locked in the world while it is down; the clock only decides when it lifts and where
it lands; the legs reach it by inverse kinematics. Slip cannot happen unless a leg runs out of reach, and the solver
steps before that.

## Pipeline (scripts in `scripts/`, details in `references/pipeline.md`)

1. **Look first**: render the GLB (`blender/prep.py` output, or any viewer). Note which way the head points, the
   tack and loose parts, and a target size (withers height in metres: horse 1.6, pony 1.2, deer 1.0).
2. **Prep** `blender -b -P blender/prep.py -- in.glb out/ WITHERS [TURN_DEG]`: weld, recalculated normals, head on
   +x, the stance levelled so all four hooves touch (generated meshes often stand a few degrees nose-down), scaled to
   metres, hooves on z = 0.
3. **Measure the joints** on `blender/legviews.py` renders (+ `grid2.py`: 5 cm grid, one side at a time). Write
   x, z of every joint into a joints JSON (`scripts/examples/horse_joints.json` is a worked example); lower leg joints
   per side (generated animals stand staggered), joints buried in the trunk symmetric. Check with the markers mode of
   `legviews.py` (x-ray): every dot inside its joint.
4. **Rig + weights** `blender -b -P blender/rig.py -- prep.blend joints.json out/`: 35 bones (trunk, neck, head,
   6 tail, per leg scapula/humerus/radius/cannon/pastern/hoof or femur/tibia/cannon/pastern/hoof), an anatomical rig
   for weights and an export rig whose bones all point +Z with no roll (identity rest in glTF). Writes `rig.json`.
5. **Offline gait check** `node sim.js rig.json poses.json`: a route of stand, walk, trot, gallop, turns, sideways
   drag and stop. PASS needs 0 hoof slip and FK == IK. `node reach.js rig.json` shows each leg's reachable range.
6. **Pose bench** `blender -b -P blender/bench.py -- rig.blend poses.json rig.json out/bench.png` + `sheet.py`:
   the solver's poses on the skinned mesh, one row per gait. Fix weights here, not in Spline.
7. **Export** `blender -b -P blender/export.py -- rig.blend out.glb PREFIX "Label"`: one GLB per animal with its
   own bone prefix (the document finds bones by name). The script checks the joint count and identity rest in the GLB.
8. **Into Spline**: the bridge cannot import a GLB: ask the user to drop each file in the open scene. Read the result
   with `get_scene`: group named after the file, an inner `<Label>_Rig` (spaces become underscores), the mesh, then
   the bones with positions in the GLB's own units (the import rescales it). Rename the outer group to the driver's
   name, file it with what pulls it (`select` + `group()` + `moveInto`), place it, scale it to the scene's units.
9. **Document**: `python3 build_block.py rig.json block.js` (rig + settings + solver + `driver.js`), insert the
   block where the host's objects and pose are known, call `gaitStep(dt, place)` every frame. `node test_driver.js
   block.js rig.json` before sending (mock bridge, mutation cases). See `references/document.md`.
10. **Verify in Play**: the beacon prints the integrity hash `build_block.py` announced, `gait: ok`, then per second
    gait, speed, cadence, stride and slip (set `window.GAIT_LAB = true` in a TEMP line). Grab frames from the page's
    canvas while a TEMP autopilot drives a fixed route; remove every TEMP line after.

## Rules that each cost a round trip

- **Heat weights fail silently on a voxel proxy with floating islands** (tack, buckles, hair cards): every weight
  is 0, one warning, no error. Keep only the proxy's largest island; loose parts get weights by transfer, and small
  parts (under 9 cm) one averaged set so they stay rigid. `rig.py` does both and retries voxel sizes.
- **Trim the scapula and femur weights** to their own region: heat weights spread them over the withers, neck base
  and croup, so a swinging leg lifts the neck or stretches the rump. Check the gallop row of the bench.
- **Every export bone must have identity rest** (bones +Z, roll 0 in Blender). The document then sets each bone's
  local rotation as `D(parent)^T * D(bone)` from world rotations, in Spline's Euler XYZ (R = Rx Ry Rz, degrees).
  Export all bones (`export_def_bones=False`): a non-deforming root is dropped otherwise and the chain breaks.
- **The hind leg is a pantograph**: the cannon keeps its rest angle to the femur (reciprocal apparatus), which makes
  hip -> fetlock a two-bone chain. The fore leg locks its carpus on the ground and folds it in the swing; the
  scapula turns with the leg and further when the hoof is out of reach.
- **Phase heave and pitch with the stances**: trunk low while hooves are loaded, high in the air. Phased the other
  way, a leg at the end of its stance overreaches and the hoof slides.
- **Never blend a bob count**: heave and nod run 2 bobs per cycle at the trot, 1 at the gallop; blending the count
  multiplies a growing phase, so the trunk and head shook (100 mm and 18 degrees per frame) through every trot <->
  gallop change. Blend each gait's result. Move leg offsets along the shortest way round the cycle: the mean of two
  nearly opposite offsets (0.03 and 0.50) is undefined mid-blend. `sim.js` fails on shake above 10 mm / 3 degrees.
- **Tails: 5 or 6 bones on the hair's measured centreline, weighted by place** (generated hair is welded to the body:
  only vertices behind the buttock line get tail weights, or the croup follows the tail). Drive them from the
  airflow (speed squared), lag only the slow part (a lag on the flutter erased 85 % of it), and check the sign: a
  positive "lift" first swung the tail end 0.5 m FORWARD under the horse. `tail_probe`-style numbers: gallop end
  0.8 m back, 0.6 m up, +-10 cm sideways.
- **Lift on "the clock is past this hoof's stance", end the swing at the clock's touchdown**: a "crossed this frame"
  test misses when the duty factor moves with speed, and a fixed swing length keeps an early lift out of step forever.
- **A hitched animal is carried sideways in turns** (the pole swings): step a hoof dragged sideways or left ahead
  before the leg runs out of reach. Without it: 23 to 33 cm of slip in a coach's turns. `sim.js` covers it.
- **Never append a comment to a generated code line**: it swallows the rest of the line.
- **A large block sent by hand gets an integrity hash**: `build_block.py` prints it, the document beacons it in Play.
- **Bone updates are cheap**: 2 animals x 33 objects per frame cost nothing measurable; a still animal sends nothing.

## Not covered

Reverse (the solver walks forward at |speed|), jumping, lying down, ears, and a rider. Gaits are tuned on a 1.6 m
horse (`gaits.js`); other animals keep the rig layout and need their cadences (`references/gait.md`).

Files in this skill

  • SUBSKILL.md9.7 KB
  • evals/prompts.md1.5 KB
  • references/document.md4.8 KB
  • references/gait.md4.4 KB
  • references/pipeline.md3.6 KB
  • scripts/blender/bench.py3.1 KB
  • scripts/blender/export.py2.4 KB
  • scripts/blender/grid2.py1 KB
  • scripts/blender/legviews.py2.9 KB
  • scripts/blender/prep.py5.2 KB
  • scripts/blender/rig.py13.3 KB
  • scripts/build_block.py2.3 KB
  • scripts/check.mjs2.7 KB
  • scripts/driver.js6.5 KB
  • scripts/examples/horse_joints.json2.1 KB
  • scripts/examples/horse_rig.json4.1 KB
  • scripts/gait.js21.7 KB
  • scripts/gaits.js1.5 KB
  • scripts/reach.js1 KB
  • scripts/sheet.py350 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.