Skip to content

Commit e7d0db6

Browse files
TMHSDigitalclaude
andcommitted
fix(examples): temp-override-join staircase stands on plinths instead of hanging
Render path only. The check, its assertions and exit codes are unchanged. examples/gallery.json and docs/gallery/index.html also carry the gn-instance-grid, hay-bale and treasure-chest card alts. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
1 parent 1b23575 commit e7d0db6

7 files changed

Lines changed: 89 additions & 21 deletions

File tree

-298 Bytes
Loading
-120 Bytes
Loading

‎docs/gallery/index.html‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ <h2><a href="shader-node-group/">shader-node-group</a></h2>
431431
</article>
432432
<article class="card" data-tags="operators context">
433433
<a class="card-media" href="temp-override-join/" tabindex="-1" aria-hidden="true">
434-
<img src="assets/temp-override-join-hero.webp" alt="Three orange cubes joined into a single diagonal staircase object." loading="lazy" decoding="async" />
434+
<img src="assets/temp-override-join-hero.webp" alt="Three amber cubes joined into a single diagonal staircase object, the upper steps standing on grey plinths." loading="lazy" decoding="async" />
435435
</a>
436436
<div class="card-body">
437437
<h2><a href="temp-override-join/">temp-override-join</a></h2>
@@ -442,7 +442,7 @@ <h2><a href="temp-override-join/">temp-override-join</a></h2>
442442
</article>
443443
<article class="card" data-tags="geometry-nodes instancing">
444444
<a class="card-media" href="gn-instance-grid/" tabindex="-1" aria-hidden="true">
445-
<img src="assets/gn-instance-grid-hero.webp" alt="A three-by-three grid of green instanced cubes on a dark floor." loading="lazy" decoding="async" />
445+
<img src="assets/gn-instance-grid-hero.webp" alt="A three-by-three grid of green instanced cubes, each sitting on a node of a faint source-grid lattice on a dark floor." loading="lazy" decoding="async" />
446446
</a>
447447
<div class="card-body">
448448
<h2><a href="gn-instance-grid/">gn-instance-grid</a></h2>
@@ -970,7 +970,7 @@ <h2><a href="street-lantern/">street-lantern</a></h2>
970970
</article>
971971
<article class="card" data-tags="mesh export showcase">
972972
<a class="card-media" href="treasure-chest/" tabindex="-1" aria-hidden="true">
973-
<img src="assets/treasure-chest-hero.webp" alt="An open wooden treasure chest with a vaulted lid and dark iron bands." loading="lazy" decoding="async" />
973+
<img src="assets/treasure-chest-hero.webp" alt="An open grained wooden treasure chest with iron bands following its barrel-vaulted lid." loading="lazy" decoding="async" />
974974
</a>
975975
<div class="card-body">
976976
<h2><a href="treasure-chest/">treasure-chest</a></h2>
@@ -1179,7 +1179,7 @@ <h2><a href="wooden-ladder/">wooden-ladder</a></h2>
11791179
</article>
11801180
<article class="card" data-tags="mesh export showcase">
11811181
<a class="card-media" href="hay-bale/" tabindex="-1" aria-hidden="true">
1182-
<img src="assets/hay-bale-hero.webp" alt="A rectangular hay bale bound by two twine belts." loading="lazy" decoding="async" />
1182+
<img src="assets/hay-bale-hero.webp" alt="A golden fibrous hay bale bound by two thin twine cords with knotted loops on top." loading="lazy" decoding="async" />
11831183
</a>
11841184
<div class="card-body">
11851185
<h2><a href="hay-bale/">hay-bale</a></h2>

‎docs/gallery/temp-override-join/index.html‎

Lines changed: 44 additions & 10 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/temp-override-join-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 orange cubes joined into a single diagonal staircase object." />
19+
<meta property="og:image:alt" content="Three amber cubes joined into a single diagonal staircase object, the upper steps standing on grey plinths." />
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="temp-override-join — Examples — Blender Developer Tools" />
2323
<meta name="twitter:description" content="Join three unit cubes into a staircase under bpy.context.temp_override — the supported replacement for the removed context.copy() dict-pass form." />
2424
<meta name="twitter:image" content="https://tmhsdigital.github.io/Blender-Developer-Tools/gallery/assets/temp-override-join-hero.webp" />
25-
<meta name="twitter:image:alt" content="Three orange cubes joined into a single diagonal staircase object." />
25+
<meta name="twitter:image:alt" content="Three amber cubes joined into a single diagonal staircase object, the upper steps standing on grey plinths." />
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>temp-override-join</h1>
268268
<p>Join three unit cubes into a staircase under bpy.context.temp_override — the supported replacement for the removed context.copy() dict-pass form.</p>
269269
</header>
270270
<main id="main">
271-
<button class="detail-hero" id="heroZoom" type="button" aria-label="View full size: Three orange cubes joined into a single diagonal staircase object.">
272-
<img src="../assets/temp-override-join-hero.webp" alt="Three orange cubes joined into a single diagonal staircase object." width="1280" height="720" />
271+
<button class="detail-hero" id="heroZoom" type="button" aria-label="View full size: Three amber cubes joined into a single diagonal staircase object, the upper steps standing on grey plinths.">
272+
<img src="../assets/temp-override-join-hero.webp" alt="Three amber cubes joined into a single diagonal staircase object, the upper steps standing on grey plinths." 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> temp_override actually applies: join consumes the sources, exactly one mesh remains, topology is verts = 8 × steps, and local Z spans all three steps.</div>
@@ -427,6 +427,34 @@ <h2>Source</h2>
427427
<span class="c"># center the staircase footprint; origin is step-0 center</span>
428428
obj.location = (-(STEPS - <span class="n">1</span>) * CUBE_SIZE / <span class="n">2</span>, <span class="n">0.0</span>, HALF)
429429

430+
<span class="c"># Stepped plinths under steps 1 and up. The joined steps meet only</span>
431+
<span class="c"># along an edge (the geometry the check asserts), so without support</span>
432+
<span class="c"># the upper cubes hung in the air. Render-only scaffolding, slimmer</span>
433+
<span class="c"># than a step and stopping 2 mm short so no face is shared.</span>
434+
plinth_mat = bpy.data.materials.new(<span class="s">&quot;Plinth&quot;</span>)
435+
plinth_mat.use_nodes = <span class="k">True</span>
436+
pb = plinth_mat.node_tree.nodes[<span class="s">&quot;Principled BSDF&quot;</span>]
437+
pb.inputs[<span class="s">&quot;Base Color&quot;</span>].default_value = (<span class="n">0.11</span>, <span class="n">0.115</span>, <span class="n">0.125</span>, <span class="n">1.0</span>)
438+
pb.inputs[<span class="s">&quot;Roughness&quot;</span>].default_value = <span class="n">0.75</span>
439+
plinths = []
440+
<span class="k">for</span> i <span class="k">in</span> range(<span class="n">1</span>, STEPS):
441+
top = i * CUBE_SIZE - <span class="n">0.002</span>
442+
pme = bpy.data.meshes.new(<span class="s">f&quot;</span><span class="s">Plinth</span>{i}<span class="s">&quot;</span>)
443+
pbm = bmesh.new()
444+
<span class="k">try</span>:
445+
bmesh.ops.create_cube(pbm, size=<span class="n">1.0</span>)
446+
bmesh.ops.scale(pbm, vec=(CUBE_SIZE * <span class="n">0.86</span>, CUBE_SIZE * <span class="n">0.86</span>, top),
447+
verts=pbm.verts)
448+
bmesh.ops.translate(pbm, vec=(<span class="n">0.0</span>, <span class="n">0.0</span>, top / <span class="n">2.0</span>), verts=pbm.verts)
449+
pbm.to_mesh(pme)
450+
<span class="k">finally</span>:
451+
pbm.free()
452+
pme.materials.append(plinth_mat)
453+
pob = bpy.data.objects.new(<span class="s">f&quot;</span><span class="s">Plinth</span>{i}<span class="s">&quot;</span>, pme)
454+
pob.location = (obj.location.x + i * CUBE_SIZE, <span class="n">0.0</span>, <span class="n">0.0</span>)
455+
scene.collection.objects.link(pob)
456+
plinths.append(pob)
457+
430458
floor_me = bpy.data.meshes.new(<span class="s">&quot;Floor&quot;</span>)
431459
bm = bmesh.new()
432460
<span class="k">try</span>:
@@ -453,7 +481,7 @@ <h2>Source</h2>
453481
scene.world = world
454482

455483
aim = bpy.data.objects.new(<span class="s">&quot;Aim&quot;</span>, <span class="k">None</span>)
456-
aim.location = (<span class="n">0.0</span>, <span class="n">0.0</span>, STEPS * CUBE_SIZE / <span class="n">2</span>)
484+
aim.location = (<span class="n">0.0</span>, <span class="n">0.0</span>, STEPS * CUBE_SIZE * <span class="n">0.4</span>)
457485
scene.collection.objects.link(aim)
458486

459487
<span class="k">def</span> light(name, loc, energy, size, col):
@@ -469,14 +497,19 @@ <h2>Source</h2>
469497
lc.track_axis = <span class="s">&#x27;TRACK_NEGATIVE_Z&#x27;</span>
470498
lc.up_axis = <span class="s">&#x27;UP_Y&#x27;</span>
471499

472-
light(<span class="s">&quot;Key&quot;</span>, (-<span class="n">4.0</span>, -<span class="n">5.0</span>, <span class="n">6.0</span>), <span class="n">1500.0</span>, <span class="n">6.0</span>, (<span class="n">1.0</span>, <span class="n">0.98</span>, <span class="n">0.94</span>))
473-
light(<span class="s">&quot;Fill&quot;</span>, (<span class="n">5.0</span>, -<span class="n">3.5</span>, <span class="n">3.0</span>), <span class="n">340.0</span>, <span class="n">8.0</span>, (<span class="n">0.8</span>, <span class="n">0.87</span>, <span class="n">1.0</span>))
474-
light(<span class="s">&quot;Rim&quot;</span>, (<span class="n">1.5</span>, <span class="n">5.0</span>, <span class="n">2.5</span>), <span class="n">480.0</span>, <span class="n">4.0</span>, (<span class="n">1.0</span>, <span class="n">0.75</span>, <span class="n">0.45</span>))
500+
<span class="c"># 1500 W was tuned under the default AgX view; under Standard it lifted</span>
501+
<span class="c"># the frame above the calibration luma band.</span>
502+
light(<span class="s">&quot;Key&quot;</span>, (-<span class="n">4.0</span>, -<span class="n">5.0</span>, <span class="n">6.0</span>), <span class="n">950.0</span>, <span class="n">6.0</span>, (<span class="n">1.0</span>, <span class="n">0.98</span>, <span class="n">0.94</span>))
503+
<span class="c"># Fill and rim softened: at 340 / 480 they threw a hot pool onto the</span>
504+
<span class="c"># floor to the right of the steps, the brightest thing in frame.</span>
505+
light(<span class="s">&quot;Fill&quot;</span>, (<span class="n">5.0</span>, -<span class="n">3.5</span>, <span class="n">3.0</span>), <span class="n">200.0</span>, <span class="n">8.0</span>, (<span class="n">0.8</span>, <span class="n">0.87</span>, <span class="n">1.0</span>))
506+
light(<span class="s">&quot;Rim&quot;</span>, (<span class="n">1.5</span>, <span class="n">5.0</span>, <span class="n">2.5</span>), <span class="n">220.0</span>, <span class="n">4.0</span>, (<span class="n">1.0</span>, <span class="n">0.75</span>, <span class="n">0.45</span>))
475507

476508
cam_data = bpy.data.cameras.new(<span class="s">&quot;Cam&quot;</span>)
477509
cam_data.lens = <span class="n">50.0</span>
478510
cam = bpy.data.objects.new(<span class="s">&quot;Cam&quot;</span>, cam_data)
479-
cam.location = (<span class="n">5.0</span>, -<span class="n">6.4</span>, <span class="n">4.6</span>)
511+
<span class="c"># Pulled back so the plinths, which reach the floor, clear the bottom edge.</span>
512+
cam.location = (<span class="n">5.7</span>, -<span class="n">7.3</span>, <span class="n">5.1</span>)
480513
scene.collection.objects.link(cam)
481514
scene.camera = cam
482515
track = cam.constraints.new(<span class="s">&#x27;TRACK_TO&#x27;</span>)
@@ -496,6 +529,7 @@ <h2>Source</h2>
496529
scene.render.resolution_y = <span class="n">720</span>
497530
scene.render.image_settings.file_format = <span class="s">&#x27;PNG&#x27;</span>
498531
scene.render.filepath = path
532+
scene.view_settings.view_transform = <span class="s">&#x27;Standard&#x27;</span> <span class="c"># docs/VISUAL-STYLE.md</span>
499533
bpy.ops.render.render(write_still=<span class="k">True</span>)
500534
<span class="k">return</span> os.path.exists(path) <span class="k">and</span> os.path.getsize(path) &gt; <span class="n">0</span>
501535

@@ -546,7 +580,7 @@ <h2>Source</h2>
546580
</main>
547581
<dialog class="lightbox" id="lightbox" aria-label="Full-size render">
548582
<button class="lightbox-close" type="button" autofocus>Close</button>
549-
<img src="../assets/temp-override-join-hero.webp" alt="Three orange cubes joined into a single diagonal staircase object." />
583+
<img src="../assets/temp-override-join-hero.webp" alt="Three amber cubes joined into a single diagonal staircase object, the upper steps standing on grey plinths." />
550584
</dialog>
551585
<footer>
552586
<div class="statusbar">

‎examples/gallery.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
"name": "temp-override-join",
114114
"dir": "examples/temp-override-join",
115115
"teaches": "Join three unit cubes into a staircase under bpy.context.temp_override — the supported replacement for the removed context.copy() dict-pass form.",
116-
"alt": "Three orange cubes joined into a single diagonal staircase object.",
116+
"alt": "Three amber cubes joined into a single diagonal staircase object, the upper steps standing on grey plinths.",
117117
"witnessesFix": "temp_override actually applies: join consumes the sources, exactly one mesh remains, topology is verts = 8 × steps, and local Z spans all three steps.",
118118
"hero": "docs/gallery/assets/temp-override-join-hero.webp",
119119
"preview": "examples/temp-override-join/preview.webp",
@@ -126,7 +126,7 @@
126126
"name": "gn-instance-grid",
127127
"dir": "examples/gn-instance-grid",
128128
"teaches": "A generative Geometry Nodes tree — Mesh Grid → Instance on Points → Realize Instances → Set Shade Smooth — attached as a NODES modifier with no Group Input geometry.",
129-
"alt": "A three-by-three grid of green instanced cubes on a dark floor.",
129+
"alt": "A three-by-three grid of green instanced cubes, each sitting on a node of a faint source-grid lattice on a dark floor.",
130130
"witnessesFix": "Realized instances produce closed-form topology (72 verts, 54 faces), Set Material carries Lime, and the corner instance center sits at its closed-form grid coordinate.",
131131
"hero": "docs/gallery/assets/gn-instance-grid-hero.webp",
132132
"preview": "examples/gn-instance-grid/preview.webp",
-266 Bytes
Loading

‎examples/temp-override-join/temp_override_join.py‎

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,34 @@ def render_still(obj, path, engine):
124124
# center the staircase footprint; origin is step-0 center
125125
obj.location = (-(STEPS - 1) * CUBE_SIZE / 2, 0.0, HALF)
126126

127+
# Stepped plinths under steps 1 and up. The joined steps meet only
128+
# along an edge (the geometry the check asserts), so without support
129+
# the upper cubes hung in the air. Render-only scaffolding, slimmer
130+
# than a step and stopping 2 mm short so no face is shared.
131+
plinth_mat = bpy.data.materials.new("Plinth")
132+
plinth_mat.use_nodes = True
133+
pb = plinth_mat.node_tree.nodes["Principled BSDF"]
134+
pb.inputs["Base Color"].default_value = (0.11, 0.115, 0.125, 1.0)
135+
pb.inputs["Roughness"].default_value = 0.75
136+
plinths = []
137+
for i in range(1, STEPS):
138+
top = i * CUBE_SIZE - 0.002
139+
pme = bpy.data.meshes.new(f"Plinth{i}")
140+
pbm = bmesh.new()
141+
try:
142+
bmesh.ops.create_cube(pbm, size=1.0)
143+
bmesh.ops.scale(pbm, vec=(CUBE_SIZE * 0.86, CUBE_SIZE * 0.86, top),
144+
verts=pbm.verts)
145+
bmesh.ops.translate(pbm, vec=(0.0, 0.0, top / 2.0), verts=pbm.verts)
146+
pbm.to_mesh(pme)
147+
finally:
148+
pbm.free()
149+
pme.materials.append(plinth_mat)
150+
pob = bpy.data.objects.new(f"Plinth{i}", pme)
151+
pob.location = (obj.location.x + i * CUBE_SIZE, 0.0, 0.0)
152+
scene.collection.objects.link(pob)
153+
plinths.append(pob)
154+
127155
floor_me = bpy.data.meshes.new("Floor")
128156
bm = bmesh.new()
129157
try:
@@ -150,7 +178,7 @@ def render_still(obj, path, engine):
150178
scene.world = world
151179

152180
aim = bpy.data.objects.new("Aim", None)
153-
aim.location = (0.0, 0.0, STEPS * CUBE_SIZE / 2)
181+
aim.location = (0.0, 0.0, STEPS * CUBE_SIZE * 0.4)
154182
scene.collection.objects.link(aim)
155183

156184
def light(name, loc, energy, size, col):
@@ -166,14 +194,19 @@ def light(name, loc, energy, size, col):
166194
lc.track_axis = 'TRACK_NEGATIVE_Z'
167195
lc.up_axis = 'UP_Y'
168196

169-
light("Key", (-4.0, -5.0, 6.0), 1500.0, 6.0, (1.0, 0.98, 0.94))
170-
light("Fill", (5.0, -3.5, 3.0), 340.0, 8.0, (0.8, 0.87, 1.0))
171-
light("Rim", (1.5, 5.0, 2.5), 480.0, 4.0, (1.0, 0.75, 0.45))
197+
# 1500 W was tuned under the default AgX view; under Standard it lifted
198+
# the frame above the calibration luma band.
199+
light("Key", (-4.0, -5.0, 6.0), 950.0, 6.0, (1.0, 0.98, 0.94))
200+
# Fill and rim softened: at 340 / 480 they threw a hot pool onto the
201+
# floor to the right of the steps, the brightest thing in frame.
202+
light("Fill", (5.0, -3.5, 3.0), 200.0, 8.0, (0.8, 0.87, 1.0))
203+
light("Rim", (1.5, 5.0, 2.5), 220.0, 4.0, (1.0, 0.75, 0.45))
172204

173205
cam_data = bpy.data.cameras.new("Cam")
174206
cam_data.lens = 50.0
175207
cam = bpy.data.objects.new("Cam", cam_data)
176-
cam.location = (5.0, -6.4, 4.6)
208+
# Pulled back so the plinths, which reach the floor, clear the bottom edge.
209+
cam.location = (5.7, -7.3, 5.1)
177210
scene.collection.objects.link(cam)
178211
scene.camera = cam
179212
track = cam.constraints.new('TRACK_TO')
@@ -193,6 +226,7 @@ def light(name, loc, energy, size, col):
193226
scene.render.resolution_y = 720
194227
scene.render.image_settings.file_format = 'PNG'
195228
scene.render.filepath = path
229+
scene.view_settings.view_transform = 'Standard' # docs/VISUAL-STYLE.md
196230
bpy.ops.render.render(write_still=True)
197231
return os.path.exists(path) and os.path.getsize(path) > 0
198232

0 commit comments

Comments
 (0)