Skip to content

Commit 295ec45

Browse files
committed
fix: restage bmesh-gear so the steel material its script specifies actually renders (incorrect PASS in #62)
1 parent 2b0c5f5 commit 295ec45

4 files changed

Lines changed: 20 additions & 14 deletions

File tree

-3.92 KB
Loading

docs/gallery/bmesh-gear/index.html

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ <h2>Source</h2>
315315
fmat = bpy.data.materials.new(<span class="s">&quot;Studio&quot;</span>)
316316
fmat.use_nodes = <span class="k">True</span>
317317
fb = fmat.node_tree.nodes[<span class="s">&quot;Principled BSDF&quot;</span>]
318-
fb.inputs[<span class="s">&quot;Base Color&quot;</span>].default_value = (<span class="n">0.055</span>, <span class="n">0.06</span>, <span class="n">0.07</span>, <span class="n">1.0</span>)
319-
fb.inputs[<span class="s">&quot;Roughness&quot;</span>].default_value = <span class="n">0.5</span>
318+
fb.inputs[<span class="s">&quot;Base Color&quot;</span>].default_value = (<span class="n">0.03</span>, <span class="n">0.032</span>, <span class="n">0.037</span>, <span class="n">1.0</span>)
319+
fb.inputs[<span class="s">&quot;Roughness&quot;</span>].default_value = <span class="n">0.7</span>
320320
floor_me.materials.append(fmat)
321321
floor = bpy.data.objects.new(<span class="s">&quot;Floor&quot;</span>, floor_me)
322322
scene.collection.objects.link(floor)
@@ -328,7 +328,7 @@ <h2>Source</h2>
328328
world = bpy.data.worlds.new(<span class="s">&quot;World&quot;</span>)
329329
world.use_nodes = <span class="k">True</span>
330330
<span class="c"># metals reflect the environment: keep a faint cool ambient so flanks never go black</span>
331-
world.node_tree.nodes[<span class="s">&quot;Background&quot;</span>].inputs[<span class="s">&quot;Color&quot;</span>].default_value = (<span class="n">0.035</span>, <span class="n">0.04</span>, <span class="n">0.05</span>, <span class="n">1.0</span>)
331+
world.node_tree.nodes[<span class="s">&quot;Background&quot;</span>].inputs[<span class="s">&quot;Color&quot;</span>].default_value = (<span class="n">0.02</span>, <span class="n">0.022</span>, <span class="n">0.028</span>, <span class="n">1.0</span>)
332332
scene.world = world
333333

334334
<span class="k">def</span> light(name, loc, energy, size, col, rot):
@@ -339,10 +339,11 @@ <h2>Source</h2>
339339
ob.rotation_euler = tuple(math.radians(a) <span class="k">for</span> a <span class="k">in</span> rot)
340340
scene.collection.objects.link(ob)
341341

342-
<span class="c"># metals live on reflections: big soft key, strong cool fill, warm rim kept low</span>
343-
light(<span class="s">&quot;Key&quot;</span>, (-<span class="n">3.5</span>, -<span class="n">4.5</span>, <span class="n">5.5</span>), <span class="n">1400.0</span>, <span class="n">7.0</span>, (<span class="n">1.0</span>, <span class="n">0.98</span>, <span class="n">0.94</span>), (<span class="n">48</span>, <span class="n">0</span>, -<span class="n">35</span>))
344-
light(<span class="s">&quot;Fill&quot;</span>, (<span class="n">5.0</span>, -<span class="n">3.5</span>, <span class="n">2.5</span>), <span class="n">600.0</span>, <span class="n">9.0</span>, (<span class="n">0.8</span>, <span class="n">0.87</span>, <span class="n">1.0</span>), (<span class="n">65</span>, <span class="n">0</span>, <span class="n">50</span>))
345-
light(<span class="s">&quot;Rim&quot;</span>, (<span class="n">1.5</span>, <span class="n">4.5</span>, <span class="n">2.2</span>), <span class="n">700.0</span>, <span class="n">4.0</span>, (<span class="n">1.0</span>, <span class="n">0.7</span>, <span class="n">0.4</span>), (-<span class="n">82</span>, <span class="n">0</span>, <span class="n">165</span>))
342+
<span class="c"># metals live on reflections: soft warm key, restrained cool fill, and the</span>
343+
<span class="c"># warm wedge raking the back wall (docs/VISUAL-STYLE.md)</span>
344+
light(<span class="s">&quot;Key&quot;</span>, (-<span class="n">3.5</span>, -<span class="n">4.5</span>, <span class="n">5.5</span>), <span class="n">700.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>), (<span class="n">48</span>, <span class="n">0</span>, -<span class="n">35</span>))
345+
light(<span class="s">&quot;Fill&quot;</span>, (<span class="n">5.0</span>, -<span class="n">3.5</span>, <span class="n">2.5</span>), <span class="n">160.0</span>, <span class="n">9.0</span>, (<span class="n">0.75</span>, <span class="n">0.85</span>, <span class="n">1.0</span>), (<span class="n">65</span>, <span class="n">0</span>, <span class="n">50</span>))
346+
light(<span class="s">&quot;Wedge&quot;</span>, (<span class="n">2.5</span>, <span class="n">5.5</span>, <span class="n">4.0</span>), <span class="n">380.0</span>, <span class="n">6.0</span>, (<span class="n">1.0</span>, <span class="n">0.76</span>, <span class="n">0.5</span>), (-<span class="n">68</span>, <span class="n">0</span>, <span class="n">190</span>))
346347

347348
cam_data = bpy.data.cameras.new(<span class="s">&quot;Cam&quot;</span>)
348349
cam_data.lens = <span class="n">55.0</span>
@@ -364,6 +365,8 @@ <h2>Source</h2>
364365
scene.render.resolution_y = <span class="n">720</span>
365366
scene.render.image_settings.file_format = <span class="s">&#x27;PNG&#x27;</span>
366367
scene.render.filepath = path
368+
<span class="c"># AgX would flatten the steel toward chalk (docs/VISUAL-STYLE.md)</span>
369+
scene.view_settings.view_transform = <span class="s">&#x27;Standard&#x27;</span>
367370
bpy.ops.render.render(write_still=<span class="k">True</span>)
368371
<span class="k">return</span> os.path.exists(path) <span class="k">and</span> os.path.getsize(path) &gt; <span class="n">0</span>
369372

examples/bmesh-gear/bmesh_gear.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ def render_still(obj, path, engine):
113113
fmat = bpy.data.materials.new("Studio")
114114
fmat.use_nodes = True
115115
fb = fmat.node_tree.nodes["Principled BSDF"]
116-
fb.inputs["Base Color"].default_value = (0.055, 0.06, 0.07, 1.0)
117-
fb.inputs["Roughness"].default_value = 0.5
116+
fb.inputs["Base Color"].default_value = (0.03, 0.032, 0.037, 1.0)
117+
fb.inputs["Roughness"].default_value = 0.7
118118
floor_me.materials.append(fmat)
119119
floor = bpy.data.objects.new("Floor", floor_me)
120120
scene.collection.objects.link(floor)
@@ -126,7 +126,7 @@ def render_still(obj, path, engine):
126126
world = bpy.data.worlds.new("World")
127127
world.use_nodes = True
128128
# metals reflect the environment: keep a faint cool ambient so flanks never go black
129-
world.node_tree.nodes["Background"].inputs["Color"].default_value = (0.035, 0.04, 0.05, 1.0)
129+
world.node_tree.nodes["Background"].inputs["Color"].default_value = (0.02, 0.022, 0.028, 1.0)
130130
scene.world = world
131131

132132
def light(name, loc, energy, size, col, rot):
@@ -137,10 +137,11 @@ def light(name, loc, energy, size, col, rot):
137137
ob.rotation_euler = tuple(math.radians(a) for a in rot)
138138
scene.collection.objects.link(ob)
139139

140-
# metals live on reflections: big soft key, strong cool fill, warm rim kept low
141-
light("Key", (-3.5, -4.5, 5.5), 1400.0, 7.0, (1.0, 0.98, 0.94), (48, 0, -35))
142-
light("Fill", (5.0, -3.5, 2.5), 600.0, 9.0, (0.8, 0.87, 1.0), (65, 0, 50))
143-
light("Rim", (1.5, 4.5, 2.2), 700.0, 4.0, (1.0, 0.7, 0.4), (-82, 0, 165))
140+
# metals live on reflections: soft warm key, restrained cool fill, and the
141+
# warm wedge raking the back wall (docs/VISUAL-STYLE.md)
142+
light("Key", (-3.5, -4.5, 5.5), 700.0, 6.0, (1.0, 0.96, 0.9), (48, 0, -35))
143+
light("Fill", (5.0, -3.5, 2.5), 160.0, 9.0, (0.75, 0.85, 1.0), (65, 0, 50))
144+
light("Wedge", (2.5, 5.5, 4.0), 380.0, 6.0, (1.0, 0.76, 0.5), (-68, 0, 190))
144145

145146
cam_data = bpy.data.cameras.new("Cam")
146147
cam_data.lens = 55.0
@@ -162,6 +163,8 @@ def light(name, loc, energy, size, col, rot):
162163
scene.render.resolution_y = 720
163164
scene.render.image_settings.file_format = 'PNG'
164165
scene.render.filepath = path
166+
# AgX would flatten the steel toward chalk (docs/VISUAL-STYLE.md)
167+
scene.view_settings.view_transform = 'Standard'
165168
bpy.ops.render.render(write_still=True)
166169
return os.path.exists(path) and os.path.getsize(path) > 0
167170

examples/bmesh-gear/preview.webp

-3.19 KB
Loading

0 commit comments

Comments
 (0)