pixelkiln 0.128.0 → 0.130.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.
- package/docs/CHARACTERS_3D.md +17 -1
- package/docs/RESEARCH_3D.md +71 -1
- package/package.json +1 -1
package/docs/CHARACTERS_3D.md
CHANGED
|
@@ -279,7 +279,23 @@ It adds `Great_Idle`, `Great_Walk`, `Great_Jog` and `Great_Attack`: the
|
|
|
279
279
|
sword's path is written in the script, both arms are solved to it, and the
|
|
280
280
|
legs and trunk come from the stock idle, walk and jog. It prints how far each
|
|
281
281
|
wrist bends, how far the blade is off its edge and whether a hand fell short.
|
|
282
|
-
To add a motion, add an entry to `MOTIONS` at the top of the script.
|
|
282
|
+
To add a motion, add an entry to `MOTIONS` at the top of the script. An entry's
|
|
283
|
+
`feet` list moves and turns the hips and steps a foot, as the attack does.
|
|
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.
|
|
283
299
|
|
|
284
300
|
Then animate as in step 8. `retarget.py` carries the library's thumb and
|
|
285
301
|
middle finger over, so the hand is a fist in a walk and closed round the grip
|
package/docs/RESEARCH_3D.md
CHANGED
|
@@ -59,6 +59,8 @@ Last updated 17 November 2026.
|
|
|
59
59
|
| 49 | The left hand, and a shield | PixelLab, Hunyuan3D-2mv, our scripts | The sword sits in either body's left hand with no change; a generated shield is strapped to the left forearm of both and stands upright through the library's motions | Keep. The shield is carried, not used: the library has no shield or left-handed motions. |
|
|
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
|
+
| 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. |
|
|
62
64
|
|
|
63
65
|
**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.
|
|
64
66
|
|
|
@@ -1403,6 +1405,73 @@ Not checked: how the motions read in play in an engine, the whole of each motion
|
|
|
1403
1405
|
|
|
1404
1406
|
**Verdict.** Keep. For a motion that exists in this form, it beats bending a one-handed one: the wrists stay inside what a wrist does and the sword goes where it was told. It is not a replacement for an animator or for captured motion.
|
|
1405
1407
|
|
|
1408
|
+
## 52. Footwork for the two-handed attack
|
|
1409
|
+
|
|
1410
|
+
**Question.** Step 51's attack moved the arms and leaned the spine over the idle's feet. Can the same written-down approach give it a step and a turn of the hips?
|
|
1411
|
+
|
|
1412
|
+
**Setup.** `wield.py` takes one more list for a motion, `feet`: at a few moments, how far the hips move forward and down, how far they turn towards the leading side, and how far the foot on the other hand's side steps forward and lifts, in leg lengths. The hips are moved and turned first, so the chest, and the sword that rides on it, turn with them. Both legs are then solved again from hip to ankle, knees forward. The standing foot keeps the place and facing the idle gave it; the stepping foot keeps its facing.
|
|
1413
|
+
|
|
1414
|
+
For `Great_Attack`: the hips turn 18 degrees towards the raised sword and shift back, the left foot lifts, and as the cut lands it comes down 0.45 leg lengths ahead with the hips forward, 0.14 leg lengths lower and turned 14 degrees the other way. Then everything returns.
|
|
1415
|
+
|
|
1416
|
+
**Result.**
|
|
1417
|
+
|
|
1418
|
+

|
|
1419
|
+
|
|
1420
|
+
- **Both feet reach their places at every moment** on both bodies, and the standing foot does not slide, since it is put where the idle had it.
|
|
1421
|
+
- **The arms are as they were:** wrists within 42 degrees on the first body and 69 on the second, both hands on the grip.
|
|
1422
|
+
- **The files are valid** and Godot 4.7.2 imports both with no errors and finds its 17 required bones. The first body's file is the same size, 2.9 MB.
|
|
1423
|
+
|
|
1424
|
+
Flaws:
|
|
1425
|
+
|
|
1426
|
+
- **A first try left a foot 2 centimetres short at rest.** The leg solver had the arms' limit of 97% of full reach, and a standing leg is straighter than that. Legs now get their full length.
|
|
1427
|
+
- **The stepping foot's toe does not roll.** It lifts and lands flat.
|
|
1428
|
+
- **The step is in place.** The character returns to where it stood; a game that wants the attack to carry it forward needs root motion, which is not written.
|
|
1429
|
+
- **The numbers were set once and looked at,** not searched as the arm poses were.
|
|
1430
|
+
|
|
1431
|
+
Not checked: the motion in play in an engine or in the site's viewer, and the idle, walk and jog, which have no footwork of their own beyond the stock legs.
|
|
1432
|
+
|
|
1433
|
+
**Verdict.** Keep. The attack reads as a lunge now, and the `feet` list is there for other motions.
|
|
1434
|
+
|
|
1435
|
+
## 53. A spear, hands apart
|
|
1436
|
+
|
|
1437
|
+
**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?
|
|
1438
|
+
|
|
1439
|
+
**Setup.**
|
|
1440
|
+
|
|
1441
|
+
- *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.
|
|
1442
|
+
|
|
1443
|
+

|
|
1444
|
+
|
|
1445
|
+
- *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.
|
|
1446
|
+
- *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.
|
|
1447
|
+
|
|
1448
|
+
**Result.**
|
|
1449
|
+
|
|
1450
|
+

|
|
1451
|
+
|
|
1452
|
+
- **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.
|
|
1453
|
+
- **First body:** the forward wrist bends at most 28 degrees and the rear one 48 to 51, and 72 in the thrust.
|
|
1454
|
+
- **Second body:** the forward wrist at most 41, the rear one 82 to 86 in all four. That is past what a wrist does.
|
|
1455
|
+
- **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.
|
|
1456
|
+
|
|
1457
|
+
Three things went wrong on the way:
|
|
1458
|
+
|
|
1459
|
+
- **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.
|
|
1460
|
+
- **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.
|
|
1461
|
+
- **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.
|
|
1462
|
+
|
|
1463
|
+
Flaws:
|
|
1464
|
+
|
|
1465
|
+
- **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.
|
|
1466
|
+
- **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.
|
|
1467
|
+
- **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.
|
|
1468
|
+
- **The body faces forward throughout.** A spear stance is side-on; only the thrust turns the hips, by 13 degrees.
|
|
1469
|
+
- **Nothing keeps the shaft out of the cape or the hip.**
|
|
1470
|
+
|
|
1471
|
+
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.
|
|
1472
|
+
|
|
1473
|
+
**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.
|
|
1474
|
+
|
|
1406
1475
|
## What has not worked, in one place
|
|
1407
1476
|
|
|
1408
1477
|
So nobody repeats them:
|
|
@@ -1437,7 +1506,7 @@ Two bugs worth remembering, because both produced plausible wrong pictures: glTF
|
|
|
1437
1506
|
- **Sixteen directions and lighting for the sprite cards** (step 31): the in-between views of step 13, and normals from the hidden mesh.
|
|
1438
1507
|
- **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.
|
|
1439
1508
|
- **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).
|
|
1440
|
-
- **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. Still to do: a handle sized to the hand,
|
|
1509
|
+
- **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. Still to do: a handle sized to the hand, root motion, poses searched for each body, and motions made for a shield or a left-handed sword.
|
|
1441
1510
|
- **A score that sees cleanliness.** Colour error against one drawing cannot tell a clean redraw from a torn render.
|
|
1442
1511
|
- **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.
|
|
1443
1512
|
- **Carve at a finer grid** than one voxel per pixel, so thin objects survive.
|
|
@@ -1535,6 +1604,7 @@ No public tool was found that takes several directional pixel sprites and return
|
|
|
1535
1604
|
- The sword of step 47: 25 generations for the eight directions, and six and a half minutes of GPU time for its mesh.
|
|
1536
1605
|
- The shield of step 49: 25 generations for the eight directions, and eight and a half minutes of GPU time for its mesh.
|
|
1537
1606
|
- The greatsword of step 50: 25 generations for the eight directions, and a little over two minutes of GPU time for its mesh.
|
|
1607
|
+
- The spear of step 53: 50 generations for two tries at the eight directions, and about five minutes of GPU time for two meshes.
|
|
1538
1608
|
- Nine meshes in step 27: about two minutes of GPU time each. Five paint runs in step 29: five to six minutes each.
|
|
1539
1609
|
|
|
1540
1610
|
## Running the scripts
|