Skip to content

Commit dbd327e

Browse files
TMHSDigitalclaude
andauthored
fix(examples): redesign gn-modifier-inputs as three GN spiral staircases (#274)
The gallery review judged the hero programmer art: three plain cubes of different size and colour, the largest cropped and flat-lit. The shared Geometry Nodes tree now builds a parametric spiral staircase from its one Float input (renamed Scale -> Height; still Socket_1): step count = round((Height - 0.3) / 0.1), oak treads with brass balusters instanced up a helix, a teal newel post and a brass helical handrail. Heights 1/2/3 m give 7/17/27 treads, so the three modifiers on one tree read left to right as one design at three settings of one input. A lost write collapses a tall staircase to the 7-step default, which the render would show. The check contract is unchanged: shared node_group, per-version write path (dict on 4.5/5.1, mod.properties.inputs on 5.2), readback, evaluated Z-extent == written value (the newel post spans exactly [0, Height]), zmin == 0, distinct extents. --same-height is the falsifier flag; --same-scale stays as an alias. Lighting: shaped key (36 deg spread) and a high rim so the foreground floor stays dark. Adds an asset-sheet SELECT row. Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent ddfac97 commit dbd327e

11 files changed

Lines changed: 648 additions & 238 deletions

File tree

‎README.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -580,15 +580,16 @@ verts = 72, faces = 54, and `Set Material` carries the lime accent.
580580
</tr>
581581
<tr>
582582
<td width="46%" valign="middle">
583-
<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>
583+
<a href="examples/gn-modifier-inputs/"><img src="examples/gn-modifier-inputs/preview.webp" alt="GN modifier inputs: three spiral staircases from one shared Geometry Nodes tree, 1, 2 and 3 meters tall with 7, 17 and 27 oak treads, proving per-modifier Height writes land on 5.2 RNA and on 4.5 dict assignment" /></a>
584584
</td>
585585
<td valign="middle">
586586

587587
### [gn-modifier-inputs](examples/gn-modifier-inputs/)
588588

589-
One Geometry Nodes tree, three modifier copies. Writes a Float Scale input through
590-
`mod.properties.inputs` on 5.2 and `mod[identifier]` on 4.5/5.1. Asserts readback and
591-
evaluated Z-extent equal 1 / 2 / 3. The 5.1 dict form raises TypeError on 5.2.
589+
One Geometry Nodes spiral-staircase tree, three modifier copies. Writes a Float Height
590+
input through `mod.properties.inputs` on 5.2 and `mod[identifier]` on 4.5/5.1; the tree
591+
turns 1 / 2 / 3 m into 7 / 17 / 27 treads. Asserts readback and evaluated Z-extent equal
592+
1 / 2 / 3. The 5.1 dict form raises TypeError on 5.2.
592593

593594
</td>
594595
</tr>
53.5 KB
Loading
21.8 KB
Loading
-3.91 KB
Loading

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

Lines changed: 310 additions & 113 deletions
Large diffs are not rendered by default.

‎docs/gallery/index.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,12 +453,12 @@ <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 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" />
456+
<img src="assets/gn-modifier-inputs-hero.webp" alt="Three spiral staircases of one design, with oak treads, teal posts and brass rails, rising left to right from seven steps to seventeen to twenty-seven." loading="lazy" decoding="async" />
457457
</a>
458458
<div class="card-body">
459459
<h2><a href="gn-modifier-inputs/">gn-modifier-inputs</a></h2>
460460
<p class="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.</p>
461-
<p class="witnesses"><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.</p>
461+
<p class="witnesses"><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 heights 1/2/3, which the shared tree turns into 7/17/27 treads.</p>
462462
<a class="card-link" href="gn-modifier-inputs/">View example<span class="sr-only"> gn-modifier-inputs</span> <span aria-hidden="true">&rarr;</span></a>
463463
</div>
464464
</article>

‎examples/gallery.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@
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 separate cubes stepping up in size from left to right: a small teal cube, an orange block and a large red block.",
143-
"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.",
142+
"alt": "Three spiral staircases of one design, with oak treads, teal posts and brass rails, rising left to right from seven steps to seventeen to twenty-seven.",
143+
"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 heights 1/2/3, which the shared tree turns into 7/17/27 treads.",
144144
"hero": "docs/gallery/assets/gn-modifier-inputs-hero.webp",
145145
"preview": "examples/gn-modifier-inputs/preview.webp",
146146
"tags": [
Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,37 @@
11
# GN Modifier Inputs
22

3-
A runnable example that attaches one Geometry Nodes tree to three cubes and
4-
writes a per-modifier Float **Scale** input through the version-appropriate
5-
API. The tree scales a 1 m cube by that value and lifts it onto the floor.
6-
Evaluated Z-extent must match the written scale (1 / 2 / 3). That is the
7-
closed form: if the write did not land, the three cubes collapse to the
8-
socket default and the extents are no longer distinct.
3+
A runnable example that attaches one Geometry Nodes tree to three carrier
4+
objects and writes a per-modifier Float **Height** input through the
5+
version-appropriate API. The tree is a parametric spiral staircase: from
6+
Height it derives the step count (`round((Height - 0.3) / 0.1)`), instances
7+
the carrier mesh — one bevelled oak tread with its brass baluster — up a
8+
helix at 22.5° per step, and adds a teal newel post and a brass helical
9+
handrail. Written heights 1 / 2 / 3 m give 7 / 17 / 27 treads, so the
10+
three staircases read left to right as one design at three settings of one
11+
input.
12+
13+
The closed form: the newel post runs from the floor at z=0 to exactly
14+
z=Height and every other part stays inside that span, so the evaluated
15+
Z-extent must equal the written height. If a write did not land, that
16+
staircase falls back to the socket default (1 m, 7 treads) and the extents
17+
are no longer distinct — in the render, the tall staircases collapse to
18+
copies of the short one.
919

1020
**What it witnesses:** Blender 5.2 removed ID-property assignment on
1121
`NodesModifier`. `mod["Socket_1"] = 2.0` raises `TypeError` rather than
1222
silently no-opping. 4.5 LTS and 5.1 still require that dict form;
1323
`mod.properties` does not exist there (`AttributeError`). 5.2+ writes
1424
`mod.properties.inputs.Socket_1.value`. After the write, the depsgraph
15-
must be updated or `evaluated_get` still sees the previous scale.
25+
must be updated or `evaluated_get` still sees the previous height.
1626

1727
Follows [`geometry-nodes-python`](../../skills/geometry-nodes-python/SKILL.md).
1828

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.
29+
Staging: the default dark studio. The three staircases stand on 1.62 m
30+
centres (`XS`); the check reads only each object's evaluated Z extent and
31+
zmin, never X, so the layout is free. All three share one tree and one set
32+
of materials — the only thing that differs between them is the modifier
33+
input. The key carries a 36° spread so its pool stays on the stairs, and
34+
the rim sits high behind them so it does not wash the foreground floor.
2435

2536
## Run
2637

@@ -29,7 +40,8 @@ duller finish keeps the tops from blowing out.
2940
blender --background --python gn_modifier_inputs.py --
3041

3142
# Portable falsifier: write 1.0 to every modifier. Must exit non-zero.
32-
blender --background --python gn_modifier_inputs.py -- --same-scale
43+
# (--same-scale is kept as an alias for the pre-staircase flag name.)
44+
blender --background --python gn_modifier_inputs.py -- --same-height
3345

3446
# Force one side of the split (must fail on the other series, not all three):
3547
blender --background --python gn_modifier_inputs.py -- --api dict
@@ -50,25 +62,29 @@ against it. `10` is the shared framing helper.
5062
| 0 | Success |
5163
| 1 | Uncaught exception (FATAL wrapper) |
5264
| 2 | argparse / usage |
53-
| 3 | Scale input identifier missing on the tree interface |
65+
| 3 | Height input identifier missing on the tree interface |
5466
| 4 | Modifiers do not share one node_group |
5567
| 5 | Version-path write raised (`--api dict` on 5.2, `--api rna` on 4.5) |
5668
| 6 | Version-path read raised |
57-
| 7 | Readback ≠ intended scale (`--same-scale` lands here) |
58-
| 8 | Evaluated Z-extent ≠ intended scale |
69+
| 7 | Readback ≠ intended height (`--same-height` lands here) |
70+
| 8 | Evaluated Z-extent ≠ intended height |
5971
| 9 | Evaluated mesh not sitting on z=0 |
6072
| 10 | Gallery framing violation |
6173
| 11 | Evaluated extents not distinct |
6274
| 12 | `--output` produced no file |
6375

6476
The `blender-smoke` workflow runs the check on Blender 5.2 LTS and 4.5 LTS
6577
(5.1 on the weekly cron, the `needs-5.1` PR label, or manual dispatch).
66-
Smoke does not pass `--output`, `--same-scale`, or `--api dict`/`rna`.
78+
Smoke does not pass `--output`, `--same-height`, or `--api dict`/`rna`.
6779

6880
## Falsification
6981

7082
| Probe | Binary | Result |
7183
| --- | --- | --- |
7284
| `--api dict` | 5.2.1 LTS | exit 5, `TypeError: id properties not supported for this type` |
7385
| `--api rna` | 4.5.11 LTS | exit 5, `AttributeError: 'NodesModifier' object has no attribute 'properties'` |
86+
| `--api dict` | 5.1.2 | exit 0 (5.1 still takes the dict form) |
87+
| `--api rna` | 5.1.2 | exit 5, `AttributeError: 'NodesModifier' object has no attribute 'properties'` |
88+
| `--same-height` | 5.2.1, 5.1.2, 4.5.11 | exit 7, `readback 1.0 != written 2.0 on SpiralStair.H2` |
89+
| `RAIL_H = -0.5` (treads climb past the post) | 5.2.1, 4.5.11 | exit 8, `evaluated Z-extent 1.934334 != height 1.0` |
7490
| `--api auto` | 5.2.1, 5.1.2, 4.5.11 | exit 0, extents 1.000 / 2.000 / 3.000 |

0 commit comments

Comments
 (0)