Skip to content

Commit 036cd19

Browse files
fix: set VSE render size before 5.2 COLOR strips bake width/height
5.2 COLOR strips get readonly width/height from the scene resolution at new_effect. Creating at factory 1920 then rendering 96 made 0.36-scaled cells cover the frame so the mosaic pixel check sampled amber instead of crimson. Signed-off-by: fOuttaMyPaint <TMhospitalitystrategies@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 773e0e1 commit 036cd19

2 files changed

Lines changed: 34 additions & 4 deletions

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,13 @@ accessors, then re-asserted after a save/reload round-trip:
8181
`bpy.app.version` tuple (`>= (5, 0, 0)`), never on `version_string`
8282
(`"4.5.11 LTS"` is not bare semver). Each side asserts its own canonical
8383
contract plus the other side's removal/bridge state. Measured values are
84-
identical on 4.5.11 and 5.1.1, including the pixel witness.
84+
identical on 4.5.11 and 5.1.2, including the pixel witness. **5.2 LTS
85+
COLOR strips bake readonly `width`/`height` from the scene render
86+
resolution at `new_effect` time** (4.5/5.1 have no intrinsic size — scale
87+
is a fraction of the output frame). The pixel check sets 96×54 *before*
88+
building the cut list; creating at factory 1920×1080 then rendering 96×54
89+
makes 0.36-scaled cells larger than the output, C covers the frame, and
90+
TL samples amber `(0.949, 0.62, 0.102)` instead of crimson.
8591

8692
**Render:** the program wall *is* the sequencer output at frame 29 (mid
8793
cross) — crimson A, teal B, amber long-runner C, and the 50/50 cross blend,

‎examples/vse-cut-list/vse_cut_list.py‎

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@
7676
CELL_OX = 244.4 # 28 px crosshair gap, ~165 px side margins at 1280x720
7777
CELL_OY = 143.6 # 28 px gap, ~87 px top/bottom margins
7878
XF_TOL = 1e-3 # float32 transform read-back tolerance
79+
# Visual mosaic (A top-left, B top-right, C bottom-left, GC bottom-right).
80+
MOSAIC = (
81+
("A", -CELL_OX, CELL_OY),
82+
("B", CELL_OX, CELL_OY),
83+
("C", -CELL_OX, -CELL_OY),
84+
("GC", CELL_OX, -CELL_OY),
85+
)
7986

8087
A_RGB = (0.85, 0.10, 0.22) # crimson
8188
B_RGB = (0.06, 0.75, 0.80) # teal
@@ -277,8 +284,7 @@ def check(coll_owner):
277284

278285
# 9. Mosaic transforms + compositing defaults persist on the strips.
279286
xf_err = 0.0
280-
for name, ox, oy in (("A", -CELL_OX, CELL_OY), ("B", CELL_OX, CELL_OY),
281-
("C", -CELL_OX, -CELL_OY), ("GC", CELL_OX, -CELL_OY)):
287+
for name, ox, oy in MOSAIC:
282288
t = coll.get(name).transform
283289
xf_err = max(xf_err, abs(t.scale_x - CELL_SCALE),
284290
abs(t.scale_y - CELL_SCALE),
@@ -598,9 +604,27 @@ def near(got, want, tol):
598604
def check_pixels(engine):
599605
"""Compositing witness on a tiny render: cell centers carry their strip
600606
colors, the cross cell is the blend (neither source), and a margin point
601-
is stage-dark — if T1 composited independently it would be crimson."""
607+
is stage-dark — if T1 composited independently it would be crimson.
608+
609+
5.2 COLOR strips bake readonly ``width``/``height`` from the scene render
610+
resolution at ``new_effect`` time. Transform scale/offset are then in
611+
that media space, not the later output size. 4.5/5.1 COLOR strips have
612+
no intrinsic size — scale is always a fraction of the output frame.
613+
Set the tiny resolution *before* building the cut list or C (channel 4)
614+
covers the 96×54 frame and TL samples amber.
615+
"""
602616
sc = bpy.context.scene
617+
sc.render.resolution_x = PXW
618+
sc.render.resolution_y = PXH
603619
build_cut_list(sc, pix=PXW / RENDER_W)
620+
if bpy.app.version >= (5, 2, 0):
621+
a = strips_coll(sc.sequence_editor).get("A")
622+
if (a.width, a.height) != (PXW, PXH):
623+
return fail(
624+
f"5.2 COLOR size {(a.width, a.height)} != render {(PXW, PXH)} "
625+
f"— width/height bake at new_effect drifted",
626+
12,
627+
)
604628
build_stage(bpy.data.scenes["Stage"])
605629
tmp = tempfile.mkdtemp(prefix="vse_pixels_")
606630
path = os.path.join(tmp, "px.png")

0 commit comments

Comments
 (0)