Skip to content

Commit 34cdccb

Browse files
TMHSDigitalclaude
andcommitted
fix: gn-modifier-inputs presentation, cubes no longer interpenetrate
Layout and render only: XS overlapped the 2 m and 3 m cubes by 0.2 m; they now stand 0.5 m apart. Frontal camera, duller finish. The check reads only Z extents; contract and exit codes unchanged on 4.5.11, 5.1.2 and 5.2.1. Also regenerates the gallery index for all four items. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
1 parent 02ec708 commit 34cdccb

9 files changed

Lines changed: 39 additions & 28 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ verts = 72, faces = 54, and `Set Material` carries the lime accent.
562562
</tr>
563563
<tr>
564564
<td width="46%" valign="middle">
565-
<a href="examples/gn-modifier-inputs/"><img src="examples/gn-modifier-inputs/preview.webp" alt="GN modifier inputs: three cubes in teal, copper, and coral scaled to 1, 2, and 3 meters by a shared Geometry Nodes tree, proving per-modifier Scale writes land on 5.2 RNA and on 4.5 dict assignment" /></a>
565+
<a href="examples/gn-modifier-inputs/"><img src="examples/gn-modifier-inputs/preview.webp" alt="GN modifier inputs: three separate cubes in teal, copper, and coral scaled to 1, 2, and 3 meters by a shared Geometry Nodes tree, proving per-modifier Scale writes land on 5.2 RNA and on 4.5 dict assignment" /></a>
566566
</td>
567567
<td valign="middle">
568568

122 Bytes
Loading
-52 Bytes
Loading

‎docs/gallery/gn-modifier-inputs/index.html‎

Lines changed: 15 additions & 12 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/gn-modifier-inputs-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="Three boxes stepping up in size from a small teal cube to an orange block to a large red block." />
19+
<meta property="og:image:alt" content="Three separate cubes stepping up in size from left to right: a small teal cube, an orange block and a large red block." />
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="gn-modifier-inputs — Examples — Blender Developer Tools" />
2323
<meta name="twitter:description" content="Per-modifier Geometry Nodes Float inputs on a shared tree — 4.5/5.1 write mod[identifier], 5.2 writes mod.properties.inputs.Socket_1.value." />
2424
<meta name="twitter:image" content="https://tmhsdigital.github.io/Blender-Developer-Tools/gallery/assets/gn-modifier-inputs-hero.webp" />
25-
<meta name="twitter:image:alt" content="Three boxes stepping up in size from a small teal cube to an orange block to a large red block." />
25+
<meta name="twitter:image:alt" content="Three separate cubes stepping up in size from left to right: a small teal cube, an orange block and a large red block." />
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>gn-modifier-inputs</h1>
268268
<p>Per-modifier Geometry Nodes Float inputs on a shared tree — 4.5/5.1 write mod[identifier], 5.2 writes mod.properties.inputs.Socket_1.value.</p>
269269
</header>
270270
<main id="main">
271-
<button class="detail-hero" id="heroZoom" type="button" aria-label="View full size: Three boxes stepping up in size from a small teal cube to an orange block to a large red block.">
272-
<img src="../assets/gn-modifier-inputs-hero.webp" alt="Three boxes stepping up in size from a small teal cube to an orange block to a large red block." width="1280" height="720" />
271+
<button class="detail-hero" id="heroZoom" type="button" aria-label="View full size: Three separate cubes stepping up in size from left to right: a small teal cube, an orange block and a large red block.">
272+
<img src="../assets/gn-modifier-inputs-hero.webp" alt="Three separate cubes stepping up in size from left to right: a small teal cube, an orange block and a large red block." 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> The 5.1 dict form raises TypeError on 5.2 rather than silently no-opping; RNA properties are AttributeError on 4.5. Readback and evaluated Z-extent match written scales 1/2/3.</div>
@@ -281,6 +281,7 @@ <h1>gn-modifier-inputs</h1>
281281
<p>A runnable example that attaches one Geometry Nodes tree to three cubes and writes a per-modifier Float <strong>Scale</strong> input through the version-appropriate API. The tree scales a 1 m cube by that value and lifts it onto the floor. Evaluated Z-extent must match the written scale (1 / 2 / 3). That is the closed form: if the write did not land, the three cubes collapse to the socket default and the extents are no longer distinct.</p>
282282
<p><strong>What it witnesses:</strong> Blender 5.2 removed ID-property assignment on <code>NodesModifier</code>. <code>mod[&quot;Socket_1&quot;] = 2.0</code> raises <code>TypeError</code> rather than silently no-opping. 4.5 LTS and 5.1 still require that dict form; <code>mod.properties</code> does not exist there (<code>AttributeError</code>). 5.2+ writes <code>mod.properties.inputs.Socket_1.value</code>. After the write, the depsgraph must be updated or <code>evaluated_get</code> still sees the previous scale.</p>
283283
<p>Follows <a href="https://github.com/TMHSDigital/Blender-Developer-Tools/tree/main/skills/geometry-nodes-python/SKILL.md"><code>geometry-nodes-python</code></a>.</p>
284+
<p>Staging: the carriers now stand 0.5 m apart (<code>XS</code>). The old spacing overlapped the 2 m and 3 m cubes by 0.2 m. The check reads only each cube&#x27;s evaluated Z extent and zmin, never X, so this is layout only. The camera looks from the front, so small to large reads left to right, and a duller finish keeps the tops from blowing out.</p>
284285
<h2>Run</h2>
285286
<pre><code># Cheap correctness check (no render) — the CI check:
286287
blender --background --python gn_modifier_inputs.py --
@@ -346,8 +347,10 @@ <h2>Source</h2>
346347

347348
CUBE_SIZE = <span class="n">1.0</span>
348349
SCALES = (<span class="n">1.0</span>, <span class="n">2.0</span>, <span class="n">3.0</span>)
349-
<span class="c"># Half-widths 0.5 / 1.0 / 1.5; keep a clear gap, keep the 3 m cube off the right edge.</span>
350-
XS = (-<span class="n">2.2</span>, <span class="n">0.15</span>, <span class="n">2.45</span>)
350+
<span class="c"># Half-widths 0.5 / 1.0 / 1.5, with 0.5 m between neighbours. The old</span>
351+
<span class="c"># (-2.2, 0.15, 2.45) overlapped the 2 m and 3 m cubes by 0.2 m. The check</span>
352+
<span class="c"># reads only Z extents, so the layout is free.</span>
353+
XS = (-<span class="n">2.6</span>, -<span class="n">0.6</span>, <span class="n">2.4</span>)
351354
COLORS = (
352355
(<span class="n">0.05</span>, <span class="n">0.62</span>, <span class="n">0.58</span>, <span class="n">1.0</span>), <span class="c"># teal</span>
353356
(<span class="n">0.82</span>, <span class="n">0.38</span>, <span class="n">0.08</span>, <span class="n">1.0</span>), <span class="c"># copper</span>
@@ -393,8 +396,8 @@ <h2>Source</h2>
393396
mat.use_nodes = <span class="k">True</span>
394397
bsdf = mat.node_tree.nodes[<span class="s">&quot;Principled BSDF&quot;</span>]
395398
bsdf.inputs[<span class="s">&quot;Base Color&quot;</span>].default_value = color
396-
bsdf.inputs[<span class="s">&quot;Roughness&quot;</span>].default_value = <span class="n">0.28</span>
397-
bsdf.inputs[<span class="s">&quot;Metallic&quot;</span>].default_value = <span class="n">0.35</span>
399+
bsdf.inputs[<span class="s">&quot;Roughness&quot;</span>].default_value = <span class="n">0.45</span>
400+
bsdf.inputs[<span class="s">&quot;Metallic&quot;</span>].default_value = <span class="n">0.1</span>
398401
<span class="k">return</span> mat
399402

400403

@@ -603,7 +606,7 @@ <h2>Source</h2>
603606
scene.world = world
604607

605608
aim = bpy.data.objects.new(<span class="s">&quot;Aim&quot;</span>, <span class="k">None</span>)
606-
aim.location = (<span class="n">0.35</span>, <span class="n">0.0</span>, <span class="n">1.25</span>)
609+
aim.location = (<span class="n">0.25</span>, <span class="n">0.0</span>, <span class="n">1.1</span>)
607610
scene.collection.objects.link(aim)
608611

609612
<span class="k">def</span> light(name, loc, energy, size, col):
@@ -619,7 +622,7 @@ <h2>Source</h2>
619622
lc.track_axis = <span class="s">&quot;TRACK_NEGATIVE_Z&quot;</span>
620623
lc.up_axis = <span class="s">&quot;UP_Y&quot;</span>
621624

622-
light(<span class="s">&quot;Key&quot;</span>, (-<span class="n">3.8</span>, -<span class="n">5.0</span>, <span class="n">6.2</span>), <span class="n">560.0</span>, <span class="n">5.0</span>, (<span class="n">1.0</span>, <span class="n">0.96</span>, <span class="n">0.9</span>))
625+
light(<span class="s">&quot;Key&quot;</span>, (-<span class="n">5.5</span>, -<span class="n">6.0</span>, <span class="n">5.2</span>), <span class="n">380.0</span>, <span class="n">6.0</span>, (<span class="n">1.0</span>, <span class="n">0.96</span>, <span class="n">0.9</span>))
623626
light(<span class="s">&quot;Fill&quot;</span>, (<span class="n">5.4</span>, -<span class="n">3.2</span>, <span class="n">2.4</span>), <span class="n">110.0</span>, <span class="n">8.0</span>, (<span class="n">0.75</span>, <span class="n">0.85</span>, <span class="n">1.0</span>))
624627
light(<span class="s">&quot;Rim&quot;</span>, (<span class="n">0.4</span>, <span class="n">6.4</span>, <span class="n">3.8</span>), <span class="n">280.0</span>, <span class="n">3.5</span>, (<span class="n">0.6</span>, <span class="n">0.78</span>, <span class="n">1.0</span>))
625628
wedge = bpy.data.lights.new(<span class="s">&quot;Wedge&quot;</span>, <span class="s">&quot;AREA&quot;</span>)
@@ -634,7 +637,7 @@ <h2>Source</h2>
634637
cam_data = bpy.data.cameras.new(<span class="s">&quot;Cam&quot;</span>)
635638
cam_data.lens = <span class="n">50.0</span>
636639
cam = bpy.data.objects.new(<span class="s">&quot;Cam&quot;</span>, cam_data)
637-
cam.location = (<span class="n">8.1</span>, -<span class="n">10.8</span>, <span class="n">5.05</span>)
640+
cam.location = (<span class="n">1.6</span>, -<span class="n">12.4</span>, <span class="n">6.6</span>)
638641
scene.collection.objects.link(cam)
639642
scene.camera = cam
640643
track = cam.constraints.new(<span class="s">&quot;TRACK_TO&quot;</span>)
@@ -718,7 +721,7 @@ <h2>Source</h2>
718721
</main>
719722
<dialog class="lightbox" id="lightbox" aria-label="Full-size render">
720723
<button class="lightbox-close" type="button" autofocus>Close</button>
721-
<img src="../assets/gn-modifier-inputs-hero.webp" alt="Three boxes stepping up in size from a small teal cube to an orange block to a large red block." />
724+
<img src="../assets/gn-modifier-inputs-hero.webp" alt="Three separate cubes stepping up in size from left to right: a small teal cube, an orange block and a large red block." />
722725
</dialog>
723726
<footer>
724727
<div class="statusbar">

‎docs/gallery/index.html‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ <h2><a href="gn-instance-grid/">gn-instance-grid</a></h2>
453453
</article>
454454
<article class="card" data-tags="geometry-nodes modifiers">
455455
<a class="card-media" href="gn-modifier-inputs/" tabindex="-1" aria-hidden="true">
456-
<img src="assets/gn-modifier-inputs-hero.webp" alt="Three boxes stepping up in size from a small teal cube to an orange block to a large red block." loading="lazy" decoding="async" />
456+
<img src="assets/gn-modifier-inputs-hero.webp" alt="Three separate cubes stepping up in size from left to right: a small teal cube, an orange block and a large red block." loading="lazy" decoding="async" />
457457
</a>
458458
<div class="card-body">
459459
<h2><a href="gn-modifier-inputs/">gn-modifier-inputs</a></h2>
@@ -860,7 +860,7 @@ <h2><a href="cross-version-property-delete/">cross-version-property-delete</a></
860860
</article>
861861
<article class="card" data-tags="depsgraph export">
862862
<a class="card-media" href="usd-export-evaluation-mode/" tabindex="-1" aria-hidden="true">
863-
<img src="assets/usd-export-evaluation-mode-hero.webp" alt="Two grey spheres: a coarse, flat-shaded one on the left and a smooth, subdivided one on the right." loading="lazy" decoding="async" />
863+
<img src="assets/usd-export-evaluation-mode-hero.webp" alt="Two steel balls resting on the floor: a coarse, flat-shaded one on the left and a smooth, subdivided one on the right." loading="lazy" decoding="async" />
864864
</a>
865865
<div class="card-body">
866866
<h2><a href="usd-export-evaluation-mode/">usd-export-evaluation-mode</a></h2>
@@ -937,12 +937,12 @@ <h2><a href="wooden-barrel/">wooden-barrel</a></h2>
937937
</article>
938938
<article class="card" data-tags="mesh export showcase">
939939
<a class="card-media" href="campfire/" tabindex="-1" aria-hidden="true">
940-
<img src="assets/campfire-hero.webp" alt="A campfire of crossed logs in a teepee inside a ring of grey stone blocks." loading="lazy" decoding="async" />
940+
<img src="assets/campfire-hero.webp" alt="A campfire of crossed logs in a teepee, embers in the ash, inside a two-course ring of rounded grey fieldstones." loading="lazy" decoding="async" />
941941
</a>
942942
<div class="card-body">
943943
<h2><a href="campfire/">campfire</a></h2>
944944
<p class="teaches">A procedural campfire through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract.</p>
945-
<p class="witnesses"><span class="tag">witnesses</span> Recomputed: 2200 tris, three materials with 216 wood, 48 ash and 1304 stone faces, UVs in 0..1 with zero AABB overlap, outer AABB 0.807×0.808×0.404 m, LOD ratios in band, convex collider 198 tris, hygiene 0, 14 grounded bottom stones, teepee kiss 0.00001 m, course seat 0, non-empty glTF. --skip-decimate exits 9; --stray-vert 15; --lift-z/--short-stones 16; --float-logs 17; --gap-courses 18.</p>
945+
<p class="witnesses"><span class="tag">witnesses</span> Recomputed: 2760 tris, three materials with 216 wood, 48 ash and 1416 stone faces, UVs in 0..1 with zero AABB overlap, outer AABB 0.802×0.802×0.404 m, LOD ratios in band, convex collider 162 tris, hygiene 0, 14 grounded bottom stones, teepee kiss 0.00034 m, course seat 0, stone variation 0.01269 m, non-empty glTF. --skip-decimate exits 9; --stray-vert 15; --lift-z/--short-stones 16; --float-logs 17; --gap-courses 18; --uniform-stones 20.</p>
946946
<a class="card-link" href="campfire/">View showcase piece<span class="sr-only"> campfire</span> <span aria-hidden="true">&rarr;</span></a>
947947
</div>
948948
</article>
@@ -1157,12 +1157,12 @@ <h2><a href="tavern-stool/">tavern-stool</a></h2>
11571157
</article>
11581158
<article class="card" data-tags="mesh export showcase">
11591159
<a class="card-media" href="iron-cauldron/" tabindex="-1" aria-hidden="true">
1160-
<img src="assets/iron-cauldron-hero.webp" alt="A black iron cauldron hanging from a tripod of wooden poles." loading="lazy" decoding="async" />
1160+
<img src="assets/iron-cauldron-hero.webp" alt="A round-bellied black iron cauldron hanging by its bail from a tripod of wooden poles." loading="lazy" decoding="async" />
11611161
</a>
11621162
<div class="card-body">
11631163
<h2><a href="iron-cauldron/">iron-cauldron</a></h2>
1164-
<p class="teaches">A procedural hanging iron cauldron with a bulged open pot, bail, and timber tripod through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract.</p>
1165-
<p class="witnesses"><span class="tag">witnesses</span> Recomputed: 3664 tris, two materials with 224 wood and 1768 metal faces, UVs in 0..1 with zero AABB overlap, outer AABB 0.987×0.961×0.860 m, pot–leg clearance 0.046 m, 3 coaxial ferrules at zmin 0, ferrule bite −0.00185 m, hook-bail join 0, mesh hygiene all zero, LOD ratios in band, convex collider 250 tris, non-empty glTF. --skip-decimate exits 9; --stray-vert 15; --lift-z/--short-legs 16; --float-hook 17; --pipe-ferrule 18.</p>
1164+
<p class="teaches">A procedural hanging iron cauldron with a round-bellied pot, a bail threaded through flat ear rings, and a timber tripod through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract.</p>
1165+
<p class="witnesses"><span class="tag">witnesses</span> Recomputed: 3664 tris, two materials with 224 wood and 1768 metal faces, UVs in 0..1 with zero AABB overlap, outer AABB 0.987×0.961×0.860 m, pot–leg clearance 0.053 m, pot base radius 0.075 m, 3 coaxial ferrules at zmin 0, ferrule bite −0.00185 m, hook-bail join 0, bail threads both ear rings, mesh hygiene all zero, LOD ratios in band, convex collider 246 tris, non-empty glTF. --skip-decimate exits 9; --stray-vert 15; --lift-z/--short-legs 16; --float-hook/--edge-on-ears 17; --pipe-ferrule 18; --pointed-pot 19.</p>
11661166
<a class="card-link" href="iron-cauldron/">View showcase piece<span class="sr-only"> iron-cauldron</span> <span aria-hidden="true">&rarr;</span></a>
11671167
</div>
11681168
</article>

‎examples/gallery.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
"name": "gn-modifier-inputs",
140140
"dir": "examples/gn-modifier-inputs",
141141
"teaches": "Per-modifier Geometry Nodes Float inputs on a shared tree — 4.5/5.1 write mod[identifier], 5.2 writes mod.properties.inputs.Socket_1.value.",
142-
"alt": "Three boxes stepping up in size from a small teal cube to an orange block to a large red block.",
142+
"alt": "Three separate cubes stepping up in size from left to right: a small teal cube, an orange block and a large red block.",
143143
"witnessesFix": "The 5.1 dict form raises TypeError on 5.2 rather than silently no-opping; RNA properties are AttributeError on 4.5. Readback and evaluated Z-extent match written scales 1/2/3.",
144144
"hero": "docs/gallery/assets/gn-modifier-inputs-hero.webp",
145145
"preview": "examples/gn-modifier-inputs/preview.webp",

‎examples/gn-modifier-inputs/README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ must be updated or `evaluated_get` still sees the previous scale.
1616

1717
Follows [`geometry-nodes-python`](../../skills/geometry-nodes-python/SKILL.md).
1818

19+
Staging: the carriers now stand 0.5 m apart (`XS`). The old spacing
20+
overlapped the 2 m and 3 m cubes by 0.2 m. The check reads only each
21+
cube's evaluated Z extent and zmin, never X, so this is layout only. The
22+
camera looks from the front, so small to large reads left to right, and a
23+
duller finish keeps the tops from blowing out.
24+
1925
## Run
2026

2127
```bash

‎examples/gn-modifier-inputs/gn_modifier_inputs.py‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@
3636

3737
CUBE_SIZE = 1.0
3838
SCALES = (1.0, 2.0, 3.0)
39-
# Half-widths 0.5 / 1.0 / 1.5; keep a clear gap, keep the 3 m cube off the right edge.
40-
XS = (-2.2, 0.15, 2.45)
39+
# Half-widths 0.5 / 1.0 / 1.5, with 0.5 m between neighbours. The old
40+
# (-2.2, 0.15, 2.45) overlapped the 2 m and 3 m cubes by 0.2 m. The check
41+
# reads only Z extents, so the layout is free.
42+
XS = (-2.6, -0.6, 2.4)
4143
COLORS = (
4244
(0.05, 0.62, 0.58, 1.0), # teal
4345
(0.82, 0.38, 0.08, 1.0), # copper
@@ -83,8 +85,8 @@ def make_material(name, color):
8385
mat.use_nodes = True
8486
bsdf = mat.node_tree.nodes["Principled BSDF"]
8587
bsdf.inputs["Base Color"].default_value = color
86-
bsdf.inputs["Roughness"].default_value = 0.28
87-
bsdf.inputs["Metallic"].default_value = 0.35
88+
bsdf.inputs["Roughness"].default_value = 0.45
89+
bsdf.inputs["Metallic"].default_value = 0.1
8890
return mat
8991

9092

@@ -293,7 +295,7 @@ def render_still(objs, path, engine):
293295
scene.world = world
294296

295297
aim = bpy.data.objects.new("Aim", None)
296-
aim.location = (0.35, 0.0, 1.25)
298+
aim.location = (0.25, 0.0, 1.1)
297299
scene.collection.objects.link(aim)
298300

299301
def light(name, loc, energy, size, col):
@@ -309,7 +311,7 @@ def light(name, loc, energy, size, col):
309311
lc.track_axis = "TRACK_NEGATIVE_Z"
310312
lc.up_axis = "UP_Y"
311313

312-
light("Key", (-3.8, -5.0, 6.2), 560.0, 5.0, (1.0, 0.96, 0.9))
314+
light("Key", (-5.5, -6.0, 5.2), 380.0, 6.0, (1.0, 0.96, 0.9))
313315
light("Fill", (5.4, -3.2, 2.4), 110.0, 8.0, (0.75, 0.85, 1.0))
314316
light("Rim", (0.4, 6.4, 3.8), 280.0, 3.5, (0.6, 0.78, 1.0))
315317
wedge = bpy.data.lights.new("Wedge", "AREA")
@@ -324,7 +326,7 @@ def light(name, loc, energy, size, col):
324326
cam_data = bpy.data.cameras.new("Cam")
325327
cam_data.lens = 50.0
326328
cam = bpy.data.objects.new("Cam", cam_data)
327-
cam.location = (8.1, -10.8, 5.05)
329+
cam.location = (1.6, -12.4, 6.6)
328330
scene.collection.objects.link(cam)
329331
scene.camera = cam
330332
track = cam.constraints.new("TRACK_TO")
40 Bytes
Loading

0 commit comments

Comments
 (0)