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
{{ message }}
Repository navigation
Commit 481183e
Browse filesBrowse the repository at this point in the historyBrowse files
fix(examples): gate every use_nodes = True on bpy.app.version < (5, 0, 0)
5.x deprecates use_nodes on materials, worlds, lights and scenes (removal
in 6.0), and creates their node trees without it. Measured on 5.2.1:
use_nodes defaults to True and node_tree exists for all four; on 4.5.14 it
defaults to False and node_tree is None. 532 ungated assignments in 136
scripts were teaching the deprecated call, including the bmesh-gear
anatomy every new example copies. A codemod now wraps each one in
'if bpy.app.version < (5, 0, 0):', and splits the 11 one-line
'x = new(...); x.use_nodes = True' forms.
tests/check_example_rules.py rejects an ungated .use_nodes = True in
examples/, showcase/, templates/ and snippets/. A probe file without the
gate fails it.
Verified:
- smoke catalog happy paths on 5.2.1: 150 PASS;
- bmesh-gear, turntable and the anvil showcase rendered with
--output --engine cycles on 5.2.1 and 4.5.14: exit 0, no use_nodes
deprecation warnings.
compositor-glare also claimed scene.use_nodes = True raises on 5.x. On
5.2.1 it only warns; scene.node_tree is what is gone.
Closes#471
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/gallery/compositor-glare/index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ <h1>Compositor Glare</h1>
61
61
</div>
62
62
<navclass="jumpnav" aria-label="On this page"><spanclass="tag">jump to</span><ahref="#run">Run</a><ahref="#exit-codes">Exit codes</a><ahref="#source">Source</a><ahref="#related">Related</a></nav>
63
63
<sectionclass="detail-section md">
64
-
<p>A runnable example that puts bloom where it actually lives: the compositor. Three emissive rings are rendered, then a <code>Glare</code> (Fog Glow) node fed by <code>Render Layers</code> grows the halo — wired through <code>scene.compositing_node_group</code> on Blender 5.x and through <code>scene.node_tree</code> on 4.x, because the 5.0 compositor rewrite removed the scene-level tree entirely (<code>scene.use_nodes = True</code> now raises <code>AttributeError</code>).</p>
64
+
<p>A runnable example that puts bloom where it actually lives: the compositor. Three emissive rings are rendered, then a <code>Glare</code> (Fog Glow) node fed by <code>Render Layers</code> grows the halo — wired through <code>scene.compositing_node_group</code> on Blender 5.x and through <code>scene.node_tree</code> on 4.x, because the 5.0 compositor rewrite removed the scene-level tree entirely (<code>scene.node_tree</code> now raises <code>AttributeError</code>; <code>scene.use_nodes</code> survives only as a deprecated flag, removal in 6.0).</p>
65
65
<p>The Glare node changed shape with it: on 4.x it takes legacy enum properties (<code>glare_type='FOG_GLOW'</code>, <code>quality='HIGH'</code>, <code>size=6</code>), while on 5.x the same choices are menu/float <strong>input sockets</strong> (<code>inputs['Type'].default_value = 'Fog Glow'</code>). The 4.x <code>threshold</code> property is a dead shim — the real threshold is the <code>Threshold</code> input socket on both versions. And EEVEE has no <code>use_bloom</code> toggle on either version (removed in 4.2): bloom is a compositor node, period.</p>
66
66
<p><strong>What it witnesses:</strong> the halo is the compositor's output, proven with pixels. The check renders the scene twice at 96×54 (single-sample Cycles, noise-free) — once with <code>use_compositing</code> on, once off — and samples a column of pixels above the middle ring's silhouette via <code>world_to_camera_view</code>. With the compositor on, the halo luminance just outside the silhouette is far above zero and falls off strictly with distance (the Fog Glow kernel signature); with it off, those same pixels are exactly zero. The structural check pins the wiring (<code>Render Layers → Glare → output</code>), the version-correct tree plumbing, and the absence of any EEVEE bloom toggle.</p>
67
67
<h2id="run">Run<aclass="anchor" href="#run" aria-label="Link to this section">#</a></h2>
0 commit comments