You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: harden example checks and close review findings across eight examples (#56)
A full review pass over the sixteen examples found the oldest four predate
the bmesh-gear anatomy and carried real debt; this closes everything
actionable:
- depsgraph-export: replace the shipped scratch docstring ("Candidate B ...
(SCRATCH)") with the standard anatomy, and add the missing --output render
path (base cube beside its evaluated form, resting the subsurf ball on the
floor via its own evaluated bounds) so the gallery assets now come from the
shipped script; OBJ path moves to --obj.
- swatch-grid: add the check-only default mode CI conventions promise
(--output was required), and make the EEVEE engine-id assertion real.
- swatch-grid / turntable / gn-sdf-remesh: the old engine-id check compared
a value to itself and could never fire; it now witnesses the inversion by
asserting the WRONG era's id is rejected (TypeError) and the helper's id
accepted - live-verified on 4.5.11 and 5.1.2.
- wave-displace: the vertex-count guard was unreachable (foreach_set cannot
resize); replaced with a strictly stronger every-vertex closed-form check
that a stride/interleave bug cannot hide from.
- damped-track-aim: delete the inert legacy EEVEE bloom block (use_bloom
exists on neither supported version and contradicted compositor-glare),
fix the orphaned wall mesh copy, and correct the cos(3.6deg) comment.
- driver-wave: remove the unreachable else branch in the driver function.
- Backport the always-free-bmesh try/finally and the taa_render_samples shim
to the early examples that lacked them; sync READMEs, gallery.json, the
smoke workflow comment, and regenerate docs/gallery.
All six touched checks pass check-only on Blender 4.5.11 LTS and 5.1.2;
swatch-grid's CI render invocation and the new depsgraph-export render were
run and visually inspected on both.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/gallery/damped-track-aim/index.html
+4-15Lines changed: 4 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -184,7 +184,7 @@ <h1>damped-track-aim</h1>
184
184
</div>
185
185
<sectionclass="detail-section md">
186
186
<p>A runnable example that aims twelve brass spikes at an ember core with <code>Object.constraints.new('DAMPED_TRACK')</code> — the data-API path, not <code>bpy.ops.object.constraint_add</code> (which needs an active object and fails in headless loops). Damped Track is the twist-stable aim constraint: it points one local axis at a target without the roll fights Track To is known for.</p>
187
-
<p><strong>What it witnesses:</strong> every spike carries exactly one unmuted <code>DAMPED_TRACK</code> bound to the core on <code>TRACK_Z</code>. After a depsgraph update, each evaluated local <code>+Z</code> aligns with the world vector toward the core (dot ≥ 0.998 ≈ 3°). A missing constraint, a muted one, a <code>TRACK_TO</code> stand-in, or a flipped axis fails the check.</p>
187
+
<p><strong>What it witnesses:</strong> every spike carries exactly one unmuted <code>DAMPED_TRACK</code> bound to the core on <code>TRACK_Z</code>. After a depsgraph update, each evaluated local <code>+Z</code> aligns with the world vector toward the core (dot ≥ 0.998 ≈ 3.6°). A missing constraint, a muted one, a <code>TRACK_TO</code> stand-in, or a flipped axis fails the check.</p>
188
188
<h2>Run</h2>
189
189
<pre><code># Cheap correctness check (no render) — the CI check:
print(<spanclass="s">f"</span><spanclass="s">ERROR: wrong-era EEVEE id '</span>{wrong}<spanclass="s">' was accepted</span><spanclass="s">"</span>, file=sys.stderr); <spanclass="k">return</span><spanclass="n">5</span>
<pclass="teaches">Bulk vertex IO at real scale — 9,409 vertices displaced into a standing wave with one foreach_get and one foreach_set, no per-vertex access.</p>
253
-
<pclass="witnesses"><spanclass="tag">witnesses</span> The bulk path is correct, not just fast: vertex count unchanged, Z span matches the wave amplitude, probe vertex matches the closedform exactly.</p>
253
+
<pclass="witnesses"><spanclass="tag">witnesses</span> The bulk path is correct, not just fast: the Z span matches the wave amplitude and every vertex matches the closed-form wave, so a stride bug in the flat buffer cannot hide.</p>
254
254
<aclass="card-link" href="wave-displace/">View example <spanaria-hidden="true">→</span></a>
Copy file name to clipboardExpand all lines: docs/gallery/swatch-grid/index.html
+33-14Lines changed: 33 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -185,9 +185,12 @@ <h1>swatch-grid</h1>
185
185
<sectionclass="detail-section md">
186
186
<p>A runnable example that renders a 3×2 grid of spheres — one material per cell — to a single PNG. It demonstrates the <ahref="https://github.com/TMHSDigital/Blender-Developer-Tools/tree/main/skills/procedural-materials-and-shaders/SKILL.md"><code>procedural-materials-and-shaders</code></a> patterns end to end:</p>
187
187
<ul><li><strong>Principled BSDF</strong> metals (gold, copper: high metallic, low roughness) and dielectrics (red/blue plastic, white rough), configured with <strong>string socket lookups</strong> and <strong>4-tuple colors</strong>.</li><li>The <strong>emission</strong> pattern (an emissive orange swatch).</li><li>The cross-version <strong><code>set_specular</code> shim</strong> (<code>Specular</code> → <code>Specular IOR Level</code>, renamed in Blender 4.0).</li></ul>
188
-
<p>It doubles as a live proof of the <strong>EEVEE engine-id</strong> behavior: the version-branch helper resolves <code>BLENDER_EEVEE</code> on Blender 5.x and <code>BLENDER_EEVEE_NEXT</code> on 4.2–4.5, and the chosen id is asserted against the running build before rendering — so a regression in that mapping fails the example, not just the docs.</p>
188
+
<p>It doubles as a live proof of the <strong>EEVEE engine-id</strong> behavior: the version-branch helper resolves <code>BLENDER_EEVEE</code> on Blender 5.x and <code>BLENDER_EEVEE_NEXT</code> on 4.2–4.5, and the check witnesses the inversion for real — the *other* era's id must be <strong>rejected</strong> by the running build (assignment raises <code>TypeError</code>) and the helper's id accepted — so a regression in that mapping fails the example, not just the docs.</p>
189
189
<h2>Run</h2>
190
-
<pre><code># Default: render with the build's EEVEE engine (needs a GPU/display)
190
+
<pre><code># Cheap correctness check (materials + engine-id witness, no render):
191
+
blender --background --python swatch_grid.py --
192
+
193
+
# Render and pixel-verify with the build's EEVEE engine (needs a GPU/display):
p.add_argument(<spanclass="s">"--output"</span>, default=<spanclass="k">None</span>, help=<spanclass="s">"optional: render a still PNG here"</span>)
print(<spanclass="s">f"</span><spanclass="s">ERROR: EEVEE id helper returned '</span>{eid}<spanclass="s">', engine is '</span>{sc.render.engine}<spanclass="s">',</span><spanclass="s">"</span>
print(<spanclass="s">f"</span><spanclass="s">ERROR: wrong-era EEVEE id '</span>{wrong}<spanclass="s">' was accepted by this build —</span><spanclass="s">"</span>
397
+
<spanclass="s">"the engine-id inversion this example witnesses is gone"</span>, file=sys.stderr)
0 commit comments