pixelkiln 0.129.0 → 0.131.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -282,6 +282,21 @@ wrist bends, how far the blade is off its edge and whether a hand fell short.
282
282
  To add a motion, add an entry to `MOTIONS` at the top of the script. An entry's
283
283
  `feet` list moves and turns the hips and steps a foot, as the attack does.
284
284
 
285
+ A spear or staff has no guard and its hands go apart. Say where they go, give
286
+ it to the hand that is forward, and ask for the spear motions:
287
+
288
+ ```bash
289
+ HELD_LENGTH=1.1 GRIP_AT=0.45 GRIP_APART=0.2 ITEMS="Spear=<spear.glb>:LeftHand:two-handed" python3 research/scripts/rig.py <body-light.glb> <body.rig.json> - - <character.glb>
290
+ python3 research/scripts/retarget.py <character.glb> <library.glb> <animated.glb>
291
+ SET=spear python3 research/scripts/wield.py <animated.glb> <with-spear-motions.glb>
292
+ ```
293
+
294
+ `GRIP_AT` is where the forward hand's middle is, as a share of the item's
295
+ length from its butt, and `GRIP_APART` how far behind it the other hand is.
296
+ That adds `Spear_Idle`, `Spear_Walk`, `Spear_Jog` and `Spear_Thrust`. The
297
+ stock one-handed motions do not suit a shaft; `offhand.py` can still be run
298
+ on them, but the rear hand is often off the shaft.
299
+
285
300
  Then animate as in step 8. `retarget.py` carries the library's thumb and
286
301
  middle finger over, so the hand is a fist in a walk and closed round the grip
287
302
  in a sword attack. A fist has no fingers to move and holds as drawn.
package/docs/CLI.md CHANGED
@@ -168,7 +168,10 @@ parent (a character's states, then their animations and the mirrors of
168
168
  those; a pro base drawn in another character's style; a revision of a
169
169
  still that was just made) become actionable, and the next wave takes them under
170
170
  what is left of the same budget, asking the same "Spend ...?" question each
171
- time unless `--yes`. It stops when a wave finds nothing new, when a wave
171
+ time unless `--yes`. With `--yes`, an asset whose only option is a single
172
+ candidate or one ordered frame set (an animation clip) is accepted as `index: 0`
173
+ without waiting on the pick page; assets with two or more candidates still
174
+ open it. It stops when a wave finds nothing new, when a wave
172
175
  submits nothing, or when the remaining budget cannot cover the next wave; in
173
176
  that last case the earlier waves' work is saved and the message says to run
174
177
  `gen` again with a budget for the rest. `--force` applies to the first wave
@@ -60,6 +60,8 @@ Last updated 17 November 2026.
60
60
  | 50 | Two hands on one grip | PixelLab, Hunyuan3D-2mv, our scripts | A generated greatsword in both hands of both bodies through all twelve motions, by pulling the grip in front of the body and solving both arms at every moment | Keep as a baked fallback. Wrists bend past what a wrist can in some motions; real two-handed animations would be better. |
61
61
  | 51 | Motions made for two hands | Our scripts | Four two-handed motions (a guard, a walk, a jog and a cut) made by writing down the sword's path and solving both arms to it. Wrists stay within 52 degrees on the first body, where the bent one-handed motions reached 100 | Keep. Use these where a motion exists, and step 50's bent ones for the rest. |
62
62
  | 52 | Footwork for the two-handed attack | Our scripts | The cut now has a step: the hips wind up, the left foot steps out as the blade lands, and both legs are solved again. Feet stay on the ground and wrists are unchanged | Keep. |
63
+ | 53 | A spear, hands apart | PixelLab, Hunyuan3D-2mv, our scripts | A generated spear held left hand forward with the right behind it on the shaft, and four motions made for it: a guard, a walk, a jog and a thrust with a step | Keep for the first body. The second body's rear wrist bends 82 to 86 degrees, and stock motions fit a shaft poorly. |
64
+ | 54 | The spear's rear elbow | Our scripts | The rear arm's elbow moved from back and up to out at the side, found by trying 37 places for it on both bodies | Keep. The second body's rear wrist went from 82 to 86 degrees down to 8 to 19, the first body's from 47 to 72 down to 15 to 20. |
63
65
 
64
66
  **How the percentages are measured.** The model is projected back to each of the eight camera positions and its outline is compared with the sprite's outline. The score is the area the two share divided by the area either covers, averaged over the views. 100% means the model casts exactly the sprite's shadow from every side. It measures shape only, not colour. It also favours carving, which is built from those same outlines.
65
67
 
@@ -1431,6 +1433,81 @@ Not checked: the motion in play in an engine or in the site's viewer, and the id
1431
1433
 
1432
1434
  **Verdict.** Keep. The attack reads as a lunge now, and the `feet` list is there for other motions.
1433
1435
 
1436
+ ## 53. A spear, hands apart
1437
+
1438
+ **Question.** The greatsword of steps 50 to 52 has both hands together under a guard. A spear or staff has no guard and the hands go apart on the shaft. Does the same approach carry it?
1439
+
1440
+ **Setup.**
1441
+
1442
+ - *The spear.* One PixelLab object in eight directions at 128 pixels. The first try (25 generations) came back short, with a head half its length. A second (25 more) that asked for a pole taking up almost the whole height, with a small tip, gave a long spear with a ribbon under the head. It was meshed by Hunyuan3D-2mv in 145 seconds, coloured from the sprites and thinned from 30,000 triangles to 1,499.
1443
+
1444
+ ![A spear in eight directions](../website/public/research/3d/spear-sprites.png)
1445
+
1446
+ - *Where the hands go.* Two settings for `rig.py`'s `two-handed` kind. `GRIP_AT` says where the leading hand's middle is, as a share of the item's length from its butt, and `GRIP_APART` how far below it the other hand is. Here 0.45 and 0.2, on a spear 1.1 times the body's height: the hands are about 40 centimetres apart. The spear is given to the left hand, `Spear=spear.glb:LeftHand:two-handed`, so the left hand is forward and the right is at the rear, as a right-hander holds one. That is also the first time the left hand has led.
1447
+ - *The motions.* `wield.py` with `SET=spear` makes `Spear_Idle`, `Spear_Walk` and `Spear_Jog`, the spear level with its butt outside the right hip and its point ahead, and `Spear_Thrust`, 1.2 seconds: drawn back, then driven out with a step of the left foot, the hips 0.15 leg lengths lower and the trunk leaning 17 degrees. A shaft has no edge, so the blade term is off.
1448
+
1449
+ **Result.**
1450
+
1451
+ ![Both armoured bodies with a spear: on guard, walking, drawn back, and the thrust landed in a lunge](../website/public/research/3d/spear.png)
1452
+
1453
+ - **Both hands are on the shaft and both feet reach, at every moment of the four motions, on both bodies,** with no pull-in needed.
1454
+ - **First body:** the forward wrist bends at most 28 degrees and the rear one 48 to 51, and 72 in the thrust.
1455
+ - **Second body:** the forward wrist at most 41, the rear one 82 to 86 in all four. That is past what a wrist does.
1456
+ - **The files are valid.** The first body's is 17,997 triangles and 2.9 MB with sixteen motions. Godot 4.7.2 imports both with no errors and finds its 17 required bones. The viewer has the first body as "Two hands on a spear" and opens it on the spear walk.
1457
+
1458
+ Three things went wrong on the way:
1459
+
1460
+ - **The spear went on backwards.** `rig.py` takes an item's widest place for a sword's guard and puts that end in the hand. A spear's widest place is its head. With `GRIP_AT` set the item is now turned the other way.
1461
+ - **The butt went through the body.** The first guard had the rear hand 15 centimetres from the middle of the body. The shaft now angles across so that the rear hand is outside the hip.
1462
+ - **The rear wrist bent 100 degrees.** With its elbow down, as every arm here has had it, the rear forearm lies along the shaft. A motion can now say where the other arm's elbow goes (`elbow`), and the spear motions put it back and up, so the forearm hangs to the shaft as on a cue. That brought the first body's rear wrist to the figures above.
1463
+
1464
+ Flaws:
1465
+
1466
+ - **Stock motions fit a shaft poorly.** `offhand.py` was written for hands together. On the first body the rear hand is on the shaft through three of the twelve stock motions and up to 5 centimetres off in the rest; on the second it is up to 23 centimetres off (the roll). The four made motions are the ones to use.
1467
+ - **The silhouette match of the spear's mesh is 64%,** against about 90% for the swords. On a shape four pixels wide a pixel's slip costs a lot, and the mesh looks right in the hand, but it was not looked into further.
1468
+ - **The poses were set on the first body and not searched** as the greatsword's were, which is why the second body's rear wrist is where it is.
1469
+ - **The body faces forward throughout.** A spear stance is side-on; only the thrust turns the hips, by 13 degrees.
1470
+ - **Nothing keeps the shaft out of the cape or the hip.**
1471
+
1472
+ Not checked: the model's picture in the site viewer (it loads, lists its motions and reports no errors), a staff with no head, the hands sliding on the shaft as they do in a real thrust, and the motions in play in an engine.
1473
+
1474
+ **Verdict.** Keep for the first body. The grip, the left hand leading and the rear elbow all carried over with small changes. The second body needs its own poses or wrist limits before his spear is usable. Step 54 found the cause and fixed it for both.
1475
+
1476
+ ## 54. The spear's rear elbow
1477
+
1478
+ **Question.** Step 53 left the second body's rear wrist bent 82 to 86 degrees on the spear, and blamed poses that were set on the first body. Does he need poses of his own?
1479
+
1480
+ **What was tried.** No. The grip and the shaft's direction were left alone and only the place the rear arm's elbow is asked to go was varied: 37 places (out, up and forward or back from the shoulder), each solved on both bodies as a held guard, ranked by the worse wrist of the two bodies. Step 53 had put that elbow back and up after trying a handful of places on the first body alone.
1481
+
1482
+ **Result.**
1483
+
1484
+ ![The second body from behind with his cape hidden: before, the rear arm folded behind the back; after, the elbow out at the side and the forearm down to the shaft](../website/public/research/3d/spear-rear-elbow.png)
1485
+
1486
+ - **The elbow belongs out at the side, a little up and a little forward** (0.6, 0.4, 0.3), not behind the back. The nine best places of the 37 all have the elbow forward of the shoulder; the one step 53 used came 29th.
1487
+ - **Wrist bend, most through each motion, in degrees:**
1488
+
1489
+ | | Guard | Walk | Jog | Thrust |
1490
+ |---|---|---|---|---|
1491
+ | First body, forward hand | 4 | 3 | 8 | 28 |
1492
+ | First body, rear hand, before | 48 | 47 | 51 | 72 |
1493
+ | First body, rear hand, after | 15 | 16 | 16 | 20 |
1494
+ | Second body, forward hand | 17 | 16 | 20 | 41 |
1495
+ | Second body, rear hand, before | 82 | 84 | 85 | 86 |
1496
+ | Second body, rear hand, after | 8 | 8 | 16 | 19 |
1497
+
1498
+ - **Both hands still reach at every moment on both bodies,** with no pull-in, and the loops close within 2 degrees.
1499
+ - **Both files are valid** and Godot 4.7.2 imports both with its 17 required bones. The viewer's spear model is rebuilt with the new elbow.
1500
+
1501
+ Flaws:
1502
+
1503
+ - **The first body's rear elbow now stands out from his side** more than a spearman's would. It reads as a braced arm, not a broken one, but it is a wider pose than before.
1504
+ - **The search was on a held guard only.** The thrust was not searched; its figures come from running the whole motion with the elbow the guard chose.
1505
+ - **One elbow place serves every body.** A body shaped unlike these two could want another, and nothing searches for it when a file is made.
1506
+
1507
+ Not checked: the rebuilt model's picture in the site viewer, whether the rear arm passes through the cuirass or the cape at any moment (the pictures show four moments on each body and no pass-through), and the motions in play in an engine.
1508
+
1509
+ **Verdict.** Keep. The second body's spear is usable. The fault was the elbow, not the poses.
1510
+
1434
1511
  ## What has not worked, in one place
1435
1512
 
1436
1513
  So nobody repeats them:
@@ -1465,7 +1542,7 @@ Two bugs worth remembering, because both produced plausible wrong pictures: glTF
1465
1542
  - **Sixteen directions and lighting for the sprite cards** (step 31): the in-between views of step 13, and normals from the hidden mesh.
1466
1543
  - **More directions, and animation.** Step 13 gives sixteen directions. Thirty-two would spin smoothly, and the same trick on a walk cycle would give walks in the in-between directions, which the generator does not offer.
1467
1544
  - **Fix the squat proportions.** Carve at a finer grid, or let the redraw see a true neighbour at full height (the guide sheet does this and kept proportions better on the bare character).
1468
- - **Held items.** Steps 47 to 51 put a sword in either hand, open or drawn as a fist, a shield on a forearm, and a greatsword in both hands with four motions of its own. Step 52 gave the attack a step. Still to do: a handle sized to the hand, root motion, a staff or spear, and motions made for a shield or a left-handed sword.
1545
+ - **Held items.** Steps 47 to 51 put a sword in either hand, open or drawn as a fist, a shield on a forearm, and a greatsword in both hands with four motions of its own. Step 52 gave the attack a step and step 53 added a spear with the hands apart, and step 54 moved its rear elbow so both bodies hold it with easy wrists. Still to do: a handle sized to the hand, root motion, a side-on spear stance, and motions made for a shield or a left-handed sword.
1469
1546
  - **A score that sees cleanliness.** Colour error against one drawing cannot tell a clean redraw from a torn render.
1470
1547
  - **Fewer, larger pieces in the unwrap.** The chest unwraps into a few large pieces, but the character comes out in hundreds of small ones, which is fine for a program and poor for a person or an image model to paint on. One piece per view, like a folded paper model, would make the texture a sprite sheet.
1471
1548
  - **Carve at a finer grid** than one voxel per pixel, so thin objects survive.
@@ -1563,6 +1640,7 @@ No public tool was found that takes several directional pixel sprites and return
1563
1640
  - The sword of step 47: 25 generations for the eight directions, and six and a half minutes of GPU time for its mesh.
1564
1641
  - The shield of step 49: 25 generations for the eight directions, and eight and a half minutes of GPU time for its mesh.
1565
1642
  - The greatsword of step 50: 25 generations for the eight directions, and a little over two minutes of GPU time for its mesh.
1643
+ - The spear of step 53: 50 generations for two tries at the eight directions, and about five minutes of GPU time for two meshes.
1566
1644
  - Nine meshes in step 27: about two minutes of GPU time each. Five paint runs in step 29: five to six minutes each.
1567
1645
 
1568
1646
  ## Running the scripts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelkiln",
3
- "version": "0.129.0",
3
+ "version": "0.131.0",
4
4
  "description": "Manifest-driven pixel-art generation, review, recovery, and packaging with deterministic provenance.",
5
5
  "type": "module",
6
6
  "sideEffects": false,