Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/gallery/asset-sheets/wheelbarrow.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/assets/gltf-skin-roundtrip-hero.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/assets/wheelbarrow-hero.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/contact-sheets/wheelbarrow-contact-sheet.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 19 additions & 4 deletions docs/gallery/gltf-skin-roundtrip/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ <h1>gltf-skin-roundtrip</h1>
<ul><li><strong>The skeleton survives.</strong> <code>skins[0].joints</code> names every bone; the re-imported armature carries the same 7 bones, the same parent chain, and rest matrices within 2.4e-07 — the +Y-up conversion applies to bone nodes exactly as it does to meshes (their translations convert, no rotation is written).</li><li><strong>The weights survive.</strong> Every primitive carries JOINTS_0/WEIGHTS_0; per-vertex weights on disk sum to 1 (err 3.0e-08); the re-imported vertex groups match the authored groups <strong>bit-exactly</strong> (w_err 0.0), compared as straddle-safe position keys, the same protocol as the crate example.</li><li><strong>The deformation survives.</strong> Posed identically, the re-imported rig&#x27;s evaluated mesh matches the original&#x27;s within 4.8e-07 — linear blend skinning through the file format. The comparison is by rest-position key, never sorted multisets: the exporter welds duplicate loops (32 here), so cardinalities differ and a naive sorted zip mispairs vertices (a phantom 2.29 &quot;deviation&quot; measured and fixed during authoring).</li><li><strong>The mesh must be parented to the armature.</strong> The exporter warns &quot;Armature must be the parent of skinned mesh&quot; and picks an armature by name otherwise — with two rigs in the file it can bind the wrong one.</li></ul>
<p><strong>What each check catches on failure:</strong> exporting with <code>export_skins=False</code> (exit 5 — no skin on disk), stripping the weights (exit 4 — no vertex groups), and posing the re-imported rig differently (exit 19 — deformation deviates 0.90).</p>
<p><strong>Version witness:</strong> the skins pipeline is stable between Blender 4.5 LTS and 5.1 — the exporter/importer RNA is byte-identical (probed with <code>gltf-export-roundtrip</code>), and every measured value matches to the digit on 4.5.11 and 5.1.2.</p>
<p>The render stages the authored scorpion beside the actual re-imported one — same curl, same glowing stinger — proof the skin rode the format through.</p>
<p>The render stages the authored scorpion beside the actual re-imported one — same curl, same glowing stinger — proof the skin rode the format through. Both rigs are turned three-quarters to the camera. The tail curls in the rig&#x27;s own Y-Z plane, so a head-on view saw the curl end-on: the tail stood straight up behind the body like a chimney. The yaw is composed into each armature&#x27;s world matrix, because the glTF importer leaves its armature in quaternion mode, where <code>rotation_euler</code> does nothing.</p>
<h2>Run</h2>
<pre><code># Cheap correctness check (no render) — the CI check:
blender --background --python gltf_skin_roundtrip.py --
Expand Down Expand Up @@ -360,6 +360,10 @@ <h2>Source</h2>
REST_TOL = <span class="n">1e-5</span> <span class="c"># rest-matrix round-trip tolerance</span>
LBS_TOL = <span class="n">5e-4</span>
KEY_DIGITS = <span class="n">4</span>
<span class="c"># render staging only (not part of the check): each rig&#x27;s X offset and its</span>
<span class="c"># yaw, so the tail&#x27;s curl (in the rig&#x27;s Y-Z plane) is seen in profile</span>
STILL_X = <span class="n">1.0</span>
STILL_YAW = -<span class="n">50.0</span>

EXPORT_KWARGS = dict(
export_format=<span class="s">&#x27;GLTF_SEPARATE&#x27;</span>,
Expand Down Expand Up @@ -897,9 +901,20 @@ <h2>Source</h2>
authored.data.materials.append(m)
assign_weights(authored, part_of2)
authored_arm = build_rig(authored)
<span class="c"># move the ARMATURES; the skinned meshes follow as children</span>
authored_arm.location.x = -<span class="n">1.1</span>
roundtrip_arm.location.x = <span class="n">1.1</span>
<span class="c"># move the ARMATURES; the skinned meshes follow as children. Each is</span>
<span class="c"># turned three-quarters to the camera: seen head-on, the tail stood</span>
<span class="c"># straight up behind the body like a chimney and the scorpion read</span>
<span class="c"># as a boxy robot; side-on, the arch of the tail over the back and</span>
<span class="c"># the legs down its flanks carry the read.</span>
<span class="c"># The yaw is composed into the world matrix about the rig&#x27;s own</span>
<span class="c"># origin: the glTF importer leaves its armature in quaternion mode,</span>
<span class="c"># where rotation_euler does nothing.</span>
<span class="k">for</span> arm, x <span class="k">in</span> ((authored_arm, -STILL_X), (roundtrip_arm, STILL_X)):
arm.location.x = x
bpy.context.view_layer.update()
at = mathutils.Matrix.Translation(arm.matrix_world.translation)
arm.matrix_world = (at @ mathutils.Matrix.Rotation(
math.radians(STILL_YAW), <span class="n">4</span>, <span class="s">&#x27;Z&#x27;</span>) @ at.inverted() @ arm.matrix_world)
<span class="k">if</span> <span class="k">not</span> render_still(authored, os.path.abspath(args.output), args.engine):
print(<span class="s">&quot;ERROR: render produced no file&quot;</span>, file=sys.stderr)
<span class="k">return</span> <span class="n">20</span>
Expand Down
4 changes: 2 additions & 2 deletions docs/gallery/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1036,12 +1036,12 @@ <h2><a href="park-bench/">park-bench</a></h2>
</article>
<article class="card" data-tags="mesh export showcase">
<a class="card-media" href="wheelbarrow/" tabindex="-1" aria-hidden="true">
<img src="assets/wheelbarrow-hero.webp" alt="A wooden wheelbarrow whose tray walls are stacked boards held by iron straps, with a spoked front wheel and two long handles." loading="lazy" decoding="async" />
<img src="assets/wheelbarrow-hero.webp" alt="A wooden wheelbarrow with a flared tray of stacked boards held by iron straps, its front raked out over a spoked wheel, and two long shafts running from the handles under the tray to the axle." loading="lazy" decoding="async" />
</a>
<div class="card-body">
<h2><a href="wheelbarrow/">wheelbarrow</a></h2>
<p class="teaches">A procedural wooden wheelbarrow through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract.</p>
<p class="witnesses"><span class="tag">witnesses</span> Recomputed: 2536 tris, two materials with 1157 wood and 190 metal faces, UVs in 0..1 with zero AABB overlap, outer AABB 1.556×0.630×0.572 m, zmin 0, hygiene 0, wall-floor seat 12 mm, spoke clearance 40 mm, two boards per side and front wall with 2 mm seams, LOD ratios in band (5.2 COLLAPSE leaner on LOD2), convex collider 90 tris, non-empty glTF. --skip-decimate exits 9 on LOD1; --stray-vert exits 15 on hygiene; --lift-z / --short-legs exit 16 on grounded; --fat-spokes / --float-walls / --wide-seams exit 17 on joint fit; --pipe-rim exits 18 on tread aspect.</p>
<p class="witnesses"><span class="tag">witnesses</span> Recomputed: 2440 tris, two materials with 1085 wood and 214 metal faces, UVs in 0..1 with zero AABB overlap, outer AABB 1.563x0.594x0.577 m, zmin 0, hygiene 0, both shafts one timber from grip to axle, tray flared 15 deg and raked 30 deg, wall-floor seat 8 mm, spoke clearance 52 mm, two boards per side and front wall with 2 mm seams measured in the wall&#x27;s plane, LOD ratios in band (5.2 COLLAPSE leaner on LOD2), convex collider 80 tris, non-empty glTF. --skip-decimate exits 9 on LOD1; --stray-vert exits 15 on hygiene; --lift-z / --short-legs exit 16 on grounded; --fat-spokes / --float-walls / --wide-seams exit 17 on joint fit; --pipe-rim exits 18 on tread aspect; --split-shafts exits 20 on shaft runs; --box-tray exits 21 on tray flare.</p>
<a class="card-link" href="wheelbarrow/">View showcase piece<span class="sr-only"> wheelbarrow</span> <span aria-hidden="true">&rarr;</span></a>
</div>
</article>
Expand Down
Loading
Loading