Skip to content

Commit 099ac17

Browse files
committed
fix: stage vse-cut-list hero as an editing-bay presentation
The raw sequencer frame was stylistically the furthest hero from the house look. The render now makes two passes: the authentic VSE program wall (evidence, untouched) and a dark-studio editing bay whose reference monitor displays exactly that frame (presentation). The check and --check-pixels paths are unchanged and green on 5.1.2 and 4.5.11 with identical measured values; the 4.5 render path is proven locally. Includes the explicit-UV fix: the flat screen quad's Generated coords sampled one frame strip; UVs carry the full frame. Signed-off-by: fOuttaMyPaint <TMhospitalitystrategies@gmail.com>
1 parent 9a0a844 commit 099ac17

5 files changed

Lines changed: 285 additions & 14 deletions

File tree

-1.11 KB
Loading

‎docs/gallery/vse-cut-list/index.html‎

Lines changed: 141 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ <h1>vse-cut-list</h1>
191191
<p><strong>Hazards discovered while authoring</strong> (all witnessed by the checks above):</p>
192192
<ul><li>A GAMMA_CROSS asked to outlast its inputs&#x27; overlap is <strong>silently clamped</strong> to the overlap — request length 9 over a (25, 33) overlap, get (25, 33).</li><li>A scene strip pointing at its <strong>own</strong> scene is a feedback loop and renders transparent (alpha 0) — the &quot;stage&quot; is silently absent. Source a separate scene.</li><li>Effect strips <strong>consume</strong> their inputs: input strips never composite on their own channel, and the effect&#x27;s transform applies on top of the inputs&#x27; transforms. Consumption requires the effect on a channel <strong>above</strong> its inputs; below, they keep painting independently.</li><li>An empty <code>bpy_prop_collection</code> is falsy — <code>se.strips or se.sequences</code> silently falls through to the legacy accessor on an empty timeline. Always branch on <code>hasattr</code>.</li></ul>
193193
<p><strong>Version divergence:</strong> the whole example is the divergence — gated on the <code>bpy.app.version</code> tuple (<code>&gt;= (5, 0, 0)</code>), never on <code>version_string</code> (<code>&quot;4.5.11 LTS&quot;</code> is not bare semver). Each side asserts its own canonical contract plus the other side&#x27;s removal/bridge state. Measured values are identical on 4.5.11 and 5.1.1, including the pixel witness.</p>
194-
<p><strong>Render:</strong> the program wall *is* the sequencer output at frame 29 (mid cross) — crimson A, teal B, amber long-runner C, and the 50/50 cross blend, over the Stage scene strip showing the dark studio. An off-by-one in end-exclusive span math drops its cell to the dark stage; the caption strip carries the closed form. Rendered locally with EEVEE (GPU host); the checks and <code>--check-pixels</code> need no GPU (Cycles CPU).</p>
194+
<p><strong>Render:</strong> the program wall *is* the sequencer output at frame 29 (mid cross) — crimson A, teal B, amber long-runner C, and the 50/50 cross blend, over the Stage scene strip showing the dark studio. An off-by-one in end-exclusive span math drops its cell to the dark stage; the caption strip carries the closed form. The hero presents that authentic frame on a reference monitor in a dark-studio editing bay — the pixels on the screen are the genuine sequencer output (evidence); only the bay around them is staged (presentation). Rendered locally with EEVEE (GPU host); the checks and <code>--check-pixels</code> need no GPU (Cycles CPU).</p>
195195
<h2>Run</h2>
196196
<pre><code># Cheap correctness check (no render) — the CI check:
197197
blender --background --python vse_cut_list.py --
@@ -245,16 +245,17 @@ <h2>Source</h2>
245245
The check builds a deterministic cut list, asserts every span against its
246246
closed form on each version&#x27;s canonical accessors, then proves the spans,
247247
wiring, colors, and transforms survive a save/reload round-trip. Pass
248-
--output to render the program wall staged inside the studio — the mosaic
249-
IS the sequencer output sampled mid-cross — and --check-pixels to assert
250-
the compositing contract on a tiny render (cell colors and input
251-
consumption), the way CI does:
248+
--output to render the authentic program wall (the sequencer output
249+
sampled mid-cross) presented on a reference monitor in the dark-studio
250+
editing bay, and --check-pixels to assert the compositing contract on a
251+
tiny render (cell colors and input consumption), the way CI does:
252252

253253
blender --background --python vse_cut_list.py --
254254
blender --background --python vse_cut_list.py -- --check-pixels
255255
blender --background --python vse_cut_list.py -- --output vse.png
256256
&quot;&quot;&quot;</span>
257-
<span class="k">import</span> bpy, sys, os, math, argparse, tempfile, warnings
257+
<span class="k">import</span> bpy, sys, os, math, argparse, tempfile, warnings, shutil
258+
<span class="k">import</span> mathutils
258259

259260
IS_5X = bpy.app.version &gt;= (<span class="n">5</span>, <span class="n">0</span>, <span class="n">0</span>)
260261

@@ -629,11 +630,144 @@ <h2>Source</h2>
629630
<span class="k">return</span> os.path.exists(path) <span class="k">and</span> os.path.getsize(path) &gt; <span class="n">0</span>
630631

631632

633+
<span class="k">def</span> build_bay(sc, frame_path):
634+
<span class="s">&quot;&quot;&quot;The editing-bay presentation: a reference monitor on a desk in the
635+
dark studio, its screen showing the AUTHENTIC sequencer frame. The pixels
636+
on the screen are the evidence (rendered by the VSE above); the bay is
637+
only the designed presentation around them.&quot;&quot;&quot;</span>
638+
<span class="k">import</span> bmesh
639+
640+
<span class="k">def</span> box(name, size, loc, mat):
641+
me = bpy.data.meshes.new(name)
642+
bm = bmesh.new()
643+
<span class="k">try</span>:
644+
bmesh.ops.create_cube(bm, size=<span class="n">1.0</span>,
645+
matrix=mathutils.Matrix.Diagonal((*size, <span class="n">1.0</span>)))
646+
bm.to_mesh(me)
647+
<span class="k">finally</span>:
648+
bm.free()
649+
me.materials.append(mat)
650+
ob = bpy.data.objects.new(name, me)
651+
ob.location = loc
652+
sc.collection.objects.link(ob)
653+
<span class="k">return</span> ob
654+
655+
<span class="k">def</span> pbr(name, base, metallic, roughness):
656+
mat = bpy.data.materials.new(name)
657+
mat.use_nodes = <span class="k">True</span>
658+
b = mat.node_tree.nodes[<span class="s">&quot;Principled BSDF&quot;</span>]
659+
b.inputs[<span class="s">&quot;Base Color&quot;</span>].default_value = (*base, <span class="n">1.0</span>)
660+
b.inputs[<span class="s">&quot;Metallic&quot;</span>].default_value = metallic
661+
b.inputs[<span class="s">&quot;Roughness&quot;</span>].default_value = roughness
662+
<span class="k">return</span> mat
663+
664+
gunmetal = pbr(<span class="s">&quot;BayMetal&quot;</span>, (<span class="n">0.08</span>, <span class="n">0.09</span>, <span class="n">0.10</span>), <span class="n">0.7</span>, <span class="n">0.40</span>)
665+
deskmat = pbr(<span class="s">&quot;DeskTop&quot;</span>, (<span class="n">0.05</span>, <span class="n">0.05</span>, <span class="n">0.06</span>), <span class="n">0.0</span>, <span class="n">0.80</span>)
666+
667+
<span class="c"># desk slab, stand, and the monitor bezel (screen face toward -Y)</span>
668+
box(<span class="s">&quot;Desk&quot;</span>, (<span class="n">2.80</span>, <span class="n">1.10</span>, <span class="n">0.72</span>), (<span class="n">0.0</span>, <span class="n">0.0</span>, <span class="n">0.36</span>), deskmat)
669+
box(<span class="s">&quot;StandBase&quot;</span>, (<span class="n">0.70</span>, <span class="n">0.50</span>, <span class="n">0.06</span>), (<span class="n">0.0</span>, <span class="n">0.05</span>, <span class="n">0.75</span>), gunmetal)
670+
box(<span class="s">&quot;Stand&quot;</span>, (<span class="n">0.18</span>, <span class="n">0.12</span>, <span class="n">0.50</span>), (<span class="n">0.0</span>, <span class="n">0.05</span>, <span class="n">0.99</span>), gunmetal)
671+
box(<span class="s">&quot;Bezel&quot;</span>, (<span class="n">2.06</span>, <span class="n">0.09</span>, <span class="n">1.30</span>), (<span class="n">0.0</span>, <span class="n">0.0</span>, <span class="n">1.89</span>), gunmetal)
672+
673+
<span class="c"># the screen: one unlit quad sampling the authentic frame end to end —</span>
674+
<span class="c"># emission only, so the VSE pixels read exactly as the sequencer wrote them</span>
675+
img = bpy.data.images.load(frame_path)
676+
smat = bpy.data.materials.new(<span class="s">&quot;ProgramScreen&quot;</span>)
677+
smat.use_nodes = <span class="k">True</span>
678+
nt = smat.node_tree
679+
nt.nodes.clear()
680+
out = nt.nodes.new(<span class="s">&quot;ShaderNodeOutputMaterial&quot;</span>)
681+
em = nt.nodes.new(<span class="s">&quot;ShaderNodeEmission&quot;</span>)
682+
tex = nt.nodes.new(<span class="s">&quot;ShaderNodeTexImage&quot;</span>)
683+
tex.image = img
684+
tc = nt.nodes.new(<span class="s">&quot;ShaderNodeTexCoord&quot;</span>)
685+
nt.links.new(tc.outputs[<span class="s">&quot;UV&quot;</span>], tex.inputs[<span class="s">&quot;Vector&quot;</span>])
686+
nt.links.new(tex.outputs[<span class="s">&quot;Color&quot;</span>], em.inputs[<span class="s">&quot;Color&quot;</span>])
687+
nt.links.new(em.outputs[<span class="s">&quot;Emission&quot;</span>], out.inputs[<span class="s">&quot;Surface&quot;</span>])
688+
sme = bpy.data.meshes.new(<span class="s">&quot;Screen&quot;</span>)
689+
bm = bmesh.new()
690+
<span class="k">try</span>:
691+
q = [bm.verts.new(p) <span class="k">for</span> p <span class="k">in</span> ((-<span class="n">0.96</span>, -<span class="n">0.048</span>, <span class="n">1.35</span>), (<span class="n">0.96</span>, -<span class="n">0.048</span>, <span class="n">1.35</span>),
692+
(<span class="n">0.96</span>, -<span class="n">0.048</span>, <span class="n">2.43</span>), (-<span class="n">0.96</span>, -<span class="n">0.048</span>, <span class="n">2.43</span>))]
693+
<span class="c"># explicit UVs, not Generated: the quad is flat in Y, so Generated&#x27;s</span>
694+
<span class="c"># image-V is a constant and the screen samples one strip of the frame</span>
695+
uv_layer = bm.loops.layers.uv.new(<span class="s">&quot;UVMap&quot;</span>)
696+
f = bm.faces.new(q)
697+
<span class="k">for</span> li, l <span class="k">in</span> enumerate(f.loops):
698+
l[uv_layer].uv = ((<span class="n">0.0</span>, <span class="n">0.0</span>), (<span class="n">1.0</span>, <span class="n">0.0</span>), (<span class="n">1.0</span>, <span class="n">1.0</span>), (<span class="n">0.0</span>, <span class="n">1.0</span>))[li]
699+
bm.to_mesh(sme)
700+
<span class="k">finally</span>:
701+
bm.free()
702+
sme.materials.append(smat)
703+
sob = bpy.data.objects.new(<span class="s">&quot;Screen&quot;</span>, sme)
704+
sc.collection.objects.link(sob)
705+
706+
<span class="c"># a small desk-lip caption, the bay&#x27;s only typography</span>
707+
cmat = pbr(<span class="s">&quot;CaptionGrey&quot;</span>, (<span class="n">0.42</span>, <span class="n">0.44</span>, <span class="n">0.48</span>), <span class="n">0.2</span>, <span class="n">0.6</span>)
708+
cu = bpy.data.curves.new(<span class="s">&quot;BayCaption&quot;</span>, <span class="s">&quot;FONT&quot;</span>)
709+
cu.body = <span class="s">&quot;PROGRAM&quot;</span>
710+
cu.align_x = <span class="s">&quot;CENTER&quot;</span>
711+
cu.size = <span class="n">0.10</span>
712+
cu.extrude = <span class="n">0.004</span>
713+
cob = bpy.data.objects.new(<span class="s">&quot;BayCaption&quot;</span>, cu)
714+
cob.location = (<span class="n">0.0</span>, -<span class="n">0.40</span>, <span class="n">0.73</span>)
715+
cob.data.materials.append(cmat)
716+
sc.collection.objects.link(cob)
717+
718+
719+
<span class="k">def</span> render_bay(sc, path, engine, w, h):
720+
<span class="s">&quot;&quot;&quot;Render the editing bay. The camera moves to a three-quarter view of
721+
the monitor; everything else reuses the house stage.&quot;&quot;&quot;</span>
722+
cam_data = bpy.data.cameras.new(<span class="s">&quot;BayCam&quot;</span>)
723+
cam_data.lens = <span class="n">52.0</span>
724+
cam = bpy.data.objects.new(<span class="s">&quot;BayCam&quot;</span>, cam_data)
725+
cam.location = (<span class="n">2.0</span>, -<span class="n">5.2</span>, <span class="n">1.72</span>)
726+
sc.collection.objects.link(cam)
727+
target = bpy.data.objects.new(<span class="s">&quot;BayAim&quot;</span>, <span class="k">None</span>)
728+
target.location = (<span class="n">0.0</span>, <span class="n">0.0</span>, <span class="n">1.28</span>)
729+
sc.collection.objects.link(target)
730+
con = cam.constraints.new(<span class="s">&quot;TRACK_TO&quot;</span>)
731+
con.target = target
732+
sc.camera = cam
733+
734+
sc.render.engine = <span class="s">&quot;CYCLES&quot;</span> <span class="k">if</span> engine == <span class="s">&quot;cycles&quot;</span> <span class="k">else</span> eevee_engine_id()
735+
<span class="k">if</span> engine == <span class="s">&quot;cycles&quot;</span>:
736+
sc.cycles.samples = <span class="n">64</span>
737+
sc.cycles.use_denoising = <span class="k">False</span>
738+
<span class="k">else</span>:
739+
<span class="k">try</span>:
740+
sc.eevee.taa_render_samples = <span class="n">64</span>
741+
<span class="k">except</span> AttributeError:
742+
<span class="k">pass</span>
743+
sc.render.resolution_x = w
744+
sc.render.resolution_y = h
745+
sc.render.resolution_percentage = <span class="n">100</span>
746+
sc.render.image_settings.file_format = <span class="s">&quot;PNG&quot;</span>
747+
sc.render.filepath = path
748+
<span class="c"># Standard keeps both the stage saturated and the on-screen frame true</span>
749+
sc.view_settings.view_transform = <span class="s">&quot;Standard&quot;</span>
750+
bpy.ops.render.render(write_still=<span class="k">True</span>, scene=sc.name)
751+
<span class="k">return</span> os.path.exists(path) <span class="k">and</span> os.path.getsize(path) &gt; <span class="n">0</span>
752+
753+
632754
<span class="k">def</span> render_still(path, engine):
755+
<span class="s">&quot;&quot;&quot;Two passes: the authentic sequencer frame (evidence), then the
756+
editing-bay presentation with that exact frame on the monitor screen.&quot;&quot;&quot;</span>
633757
sc = bpy.context.scene
634758
build_cut_list(sc)
635759
build_stage(bpy.data.scenes[<span class="s">&quot;Stage&quot;</span>])
636-
<span class="k">return</span> render_frame(sc, path, engine, RENDER_W, RENDER_H)
760+
tmp = tempfile.mkdtemp(prefix=<span class="s">&quot;vse_frame_&quot;</span>)
761+
<span class="k">try</span>:
762+
frame_path = os.path.join(tmp, <span class="s">&quot;program.png&quot;</span>)
763+
<span class="k">if</span> <span class="k">not</span> render_frame(sc, frame_path, engine, RENDER_W, RENDER_H):
764+
<span class="k">return</span> <span class="k">False</span>
765+
bay = bpy.data.scenes.new(<span class="s">&quot;Bay&quot;</span>)
766+
build_stage(bay) <span class="c"># the house dark studio, lights included</span>
767+
build_bay(bay, frame_path)
768+
<span class="k">return</span> render_bay(bay, path, engine, RENDER_W, RENDER_H)
769+
<span class="k">finally</span>:
770+
shutil.rmtree(tmp, ignore_errors=<span class="k">True</span>) <span class="c"># pixels live on in the blend</span>
637771

638772

639773
<span class="k">def</span> near(got, want, tol):

‎examples/vse-cut-list/README.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ identical on 4.5.11 and 5.1.1, including the pixel witness.
8787
cross) — crimson A, teal B, amber long-runner C, and the 50/50 cross blend,
8888
over the Stage scene strip showing the dark studio. An off-by-one in
8989
end-exclusive span math drops its cell to the dark stage; the caption strip
90-
carries the closed form. Rendered locally with EEVEE (GPU host); the checks
90+
carries the closed form. The hero presents that authentic frame on a
91+
reference monitor in a dark-studio editing bay — the pixels on the screen
92+
are the genuine sequencer output (evidence); only the bay around them is
93+
staged (presentation). Rendered locally with EEVEE (GPU host); the checks
9194
and `--check-pixels` need no GPU (Cycles CPU).
9295

9396
## Run

‎examples/vse-cut-list/preview.webp‎

-652 Bytes
Loading

0 commit comments

Comments
 (0)