Skip to content

Commit c05c6c5

Browse files
TMHSDigitalclaude
andauthored
fix: crate-stack, depsgraph-export and unapplied-scale-gltf quality pass (#227)
* fix(showcase): crate-stack quality pass — chamfered one-shell iron, seated nails, grained planks Adds two budgets: nail seat (exit 18, --float-nails) and zero right-angle edges (exit 21, --sharp-iron). The corner strap is now one L-section extrusion; two overlapping boxes put coplanar chamfer strips on every outer corner. The iron bevel pins material=METAL_IDX. Per-plank tone and grain direction ride as face attributes read by the wood shader. The temp glTF export is removed after it is measured. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> * fix(examples): depsgraph-export still shows the base and evaluated edge cages Render path only. The check, its assertions and exit codes are unchanged. docs/gallery/index.html also carries the crate-stack card alt from the previous commit, since both regenerate in one build. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> * docs(examples): unapplied-scale-gltf README states the contract, who hits it, and 5.1 re-verification Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> * docs(showcase): conventions for edge treatment, one-shell L sections, host-derived part classifiers, plank variation Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> --------- Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 026b568 commit c05c6c5

16 files changed

Lines changed: 983 additions & 128 deletions

File tree

2.98 KB
Loading
19.7 KB
Loading
1.51 KB
Loading
21.2 KB
Loading

‎docs/gallery/crate-stack/index.html‎

Lines changed: 400 additions & 48 deletions
Large diffs are not rendered by default.

‎docs/gallery/depsgraph-export/index.html‎

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
<meta property="og:image" content="https://tmhsdigital.github.io/Blender-Developer-Tools/gallery/assets/depsgraph-export-hero.webp" />
1717
<meta property="og:image:width" content="1280" />
1818
<meta property="og:image:height" content="720" />
19-
<meta property="og:image:alt" content="A teal cube beside a slightly faceted teal sphere on a dark studio floor." />
19+
<meta property="og:image:alt" content="A teal cube outlined by its twelve edges beside a faceted teal sphere covered in a dense pale wire grid, on a dark studio floor." />
2020
<meta property="og:site_name" content="Blender Developer Tools" />
2121
<meta name="twitter:card" content="summary_large_image" />
2222
<meta name="twitter:title" content="depsgraph-export — Examples — Blender Developer Tools" />
2323
<meta name="twitter:description" content="The depsgraph lifetime contract — evaluated_get().to_mesh() paired with to_mesh_clear() — measured against an OBJ export of the same object." />
2424
<meta name="twitter:image" content="https://tmhsdigital.github.io/Blender-Developer-Tools/gallery/assets/depsgraph-export-hero.webp" />
25-
<meta name="twitter:image:alt" content="A teal cube beside a slightly faceted teal sphere on a dark studio floor." />
25+
<meta name="twitter:image:alt" content="A teal cube outlined by its twelve edges beside a faceted teal sphere covered in a dense pale wire grid, on a dark studio floor." />
2626
<style>
2727
/* fonts are deployed by the landing build (docs/fonts/) */
2828
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap;
@@ -268,8 +268,8 @@ <h1>depsgraph-export</h1>
268268
<p>The depsgraph lifetime contract — evaluated_get().to_mesh() paired with to_mesh_clear() — measured against an OBJ export of the same object.</p>
269269
</header>
270270
<main id="main">
271-
<button class="detail-hero" id="heroZoom" type="button" aria-label="View full size: A teal cube beside a slightly faceted teal sphere on a dark studio floor.">
272-
<img src="../assets/depsgraph-export-hero.webp" alt="A teal cube beside a slightly faceted teal sphere on a dark studio floor." width="1280" height="720" />
271+
<button class="detail-hero" id="heroZoom" type="button" aria-label="View full size: A teal cube outlined by its twelve edges beside a faceted teal sphere covered in a dense pale wire grid, on a dark studio floor.">
272+
<img src="../assets/depsgraph-export-hero.webp" alt="A teal cube outlined by its twelve edges beside a faceted teal sphere covered in a dense pale wire grid, on a dark studio floor." width="1280" height="720" />
273273
</button>
274274
<p class="zoom-hint">Rendered headless by the example itself — click to zoom.</p>
275275
<div class="callout"><span class="tag">witnesses</span> Exports ship evaluated geometry: the exported vertex count equals the subsurf-applied count and is strictly greater than the base mesh.</div>
@@ -431,6 +431,28 @@ <h2>Source</h2>
431431
<span class="k">for</span> poly <span class="k">in</span> obj.data.polygons:
432432
poly.use_smooth = <span class="k">True</span>
433433

434+
<span class="c"># Edge cages over both: the check compares vertex counts, and two teal</span>
435+
<span class="c"># silhouettes alone read as &quot;a cube and a ball&quot;. The base cage shows the</span>
436+
<span class="c"># 8 verts the datablock holds; the evaluated cage is the same SUBSURF</span>
437+
<span class="c"># followed by WIREFRAME, so it draws exactly the edges the OBJ ships.</span>
438+
<span class="c"># Render-path scaffolding only: separate objects, added after check().</span>
439+
cage_mat = principled(<span class="s">&quot;Cage&quot;</span>, (<span class="n">0.92</span>, <span class="n">0.80</span>, <span class="n">0.56</span>, <span class="n">1.0</span>), <span class="n">0.0</span>, <span class="n">0.35</span>)
440+
cages = []
441+
<span class="k">for</span> src, subsurf <span class="k">in</span> ((base_obj, <span class="k">False</span>), (obj, <span class="k">True</span>)):
442+
cage = bpy.data.objects.new(src.name + <span class="s">&quot;Cage&quot;</span>, obj.data.copy())
443+
cage.data.materials.clear()
444+
cage.data.materials.append(cage_mat)
445+
cage.location = src.location
446+
cage.rotation_euler = src.rotation_euler
447+
<span class="k">if</span> subsurf:
448+
cage.modifiers.new(<span class="s">&quot;ss&quot;</span>, <span class="s">&#x27;SUBSURF&#x27;</span>).levels = <span class="n">2</span>
449+
wire = cage.modifiers.new(<span class="s">&quot;cage&quot;</span>, <span class="s">&#x27;WIREFRAME&#x27;</span>)
450+
wire.thickness = <span class="n">0.035</span> <span class="k">if</span> <span class="k">not</span> subsurf <span class="k">else</span> <span class="n">0.018</span>
451+
wire.offset = <span class="n">1.0</span> <span class="c"># grow outward so the lines sit on the surface</span>
452+
wire.use_even_offset = <span class="k">True</span>
453+
bpy.context.collection.objects.link(cage)
454+
cages.append(cage)
455+
434456
floor_me = bpy.data.meshes.new(<span class="s">&quot;Floor&quot;</span>)
435457
bm = bmesh.new()
436458
<span class="k">try</span>:
@@ -505,7 +527,7 @@ <h2>Source</h2>
505527
fcode = gallery_framing.check_framing(
506528
scene, cam,
507529
hero=[base_obj, obj],
508-
elements=[base_obj, obj],
530+
elements=[base_obj, obj] + cages,
509531
stage=[floor, wall],
510532
)
511533
<span class="k">if</span> fcode:
@@ -554,7 +576,7 @@ <h2>Source</h2>
554576
</main>
555577
<dialog class="lightbox" id="lightbox" aria-label="Full-size render">
556578
<button class="lightbox-close" type="button" autofocus>Close</button>
557-
<img src="../assets/depsgraph-export-hero.webp" alt="A teal cube beside a slightly faceted teal sphere on a dark studio floor." />
579+
<img src="../assets/depsgraph-export-hero.webp" alt="A teal cube outlined by its twelve edges beside a faceted teal sphere covered in a dense pale wire grid, on a dark studio floor." />
558580
</dialog>
559581
<footer>
560582
<div class="statusbar">

‎docs/gallery/index.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ <h2><a href="gn-sdf-remesh/">gn-sdf-remesh</a></h2>
376376
</article>
377377
<article class="card" data-tags="depsgraph export">
378378
<a class="card-media" href="depsgraph-export/" tabindex="-1" aria-hidden="true">
379-
<img src="assets/depsgraph-export-hero.webp" alt="A teal cube beside a slightly faceted teal sphere on a dark studio floor." loading="lazy" decoding="async" />
379+
<img src="assets/depsgraph-export-hero.webp" alt="A teal cube outlined by its twelve edges beside a faceted teal sphere covered in a dense pale wire grid, on a dark studio floor." loading="lazy" decoding="async" />
380380
</a>
381381
<div class="card-body">
382382
<h2><a href="depsgraph-export/">depsgraph-export</a></h2>
@@ -1190,7 +1190,7 @@ <h2><a href="hay-bale/">hay-bale</a></h2>
11901190
</article>
11911191
<article class="card" data-tags="mesh export showcase">
11921192
<a class="card-media" href="crate-stack/" tabindex="-1" aria-hidden="true">
1193-
<img src="assets/crate-stack-hero.webp" alt="Three wooden shipping crates stacked, each turned slightly differently." loading="lazy" decoding="async" />
1193+
<img src="assets/crate-stack-hero.webp" alt="Three grained wooden shipping crates stacked, each turned slightly differently, with nailed iron corner straps." loading="lazy" decoding="async" />
11941194
</a>
11951195
<div class="card-body">
11961196
<h2><a href="crate-stack/">crate-stack</a></h2>

‎examples/depsgraph-export/depsgraph_export.py‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,28 @@ def render_still(obj, path, engine):
123123
for poly in obj.data.polygons:
124124
poly.use_smooth = True
125125

126+
# Edge cages over both: the check compares vertex counts, and two teal
127+
# silhouettes alone read as "a cube and a ball". The base cage shows the
128+
# 8 verts the datablock holds; the evaluated cage is the same SUBSURF
129+
# followed by WIREFRAME, so it draws exactly the edges the OBJ ships.
130+
# Render-path scaffolding only: separate objects, added after check().
131+
cage_mat = principled("Cage", (0.92, 0.80, 0.56, 1.0), 0.0, 0.35)
132+
cages = []
133+
for src, subsurf in ((base_obj, False), (obj, True)):
134+
cage = bpy.data.objects.new(src.name + "Cage", obj.data.copy())
135+
cage.data.materials.clear()
136+
cage.data.materials.append(cage_mat)
137+
cage.location = src.location
138+
cage.rotation_euler = src.rotation_euler
139+
if subsurf:
140+
cage.modifiers.new("ss", 'SUBSURF').levels = 2
141+
wire = cage.modifiers.new("cage", 'WIREFRAME')
142+
wire.thickness = 0.035 if not subsurf else 0.018
143+
wire.offset = 1.0 # grow outward so the lines sit on the surface
144+
wire.use_even_offset = True
145+
bpy.context.collection.objects.link(cage)
146+
cages.append(cage)
147+
126148
floor_me = bpy.data.meshes.new("Floor")
127149
bm = bmesh.new()
128150
try:
@@ -197,7 +219,7 @@ def light(name, loc, energy, size, col, rot):
197219
fcode = gallery_framing.check_framing(
198220
scene, cam,
199221
hero=[base_obj, obj],
200-
elements=[base_obj, obj],
222+
elements=[base_obj, obj] + cages,
201223
stage=[floor, wall],
202224
)
203225
if fcode:
19.1 KB
Loading

‎examples/gallery.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"name": "depsgraph-export",
4848
"dir": "examples/depsgraph-export",
4949
"teaches": "The depsgraph lifetime contract — evaluated_get().to_mesh() paired with to_mesh_clear() — measured against an OBJ export of the same object.",
50-
"alt": "A teal cube beside a slightly faceted teal sphere on a dark studio floor.",
50+
"alt": "A teal cube outlined by its twelve edges beside a faceted teal sphere covered in a dense pale wire grid, on a dark studio floor.",
5151
"witnessesFix": "Exports ship evaluated geometry: the exported vertex count equals the subsurf-applied count and is strictly greater than the base mesh.",
5252
"hero": "docs/gallery/assets/depsgraph-export-hero.webp",
5353
"preview": "examples/depsgraph-export/preview.webp",

0 commit comments

Comments
 (0)