Skip to content

Commit 598c6a3

Browse files
committed
feat: add vse-gamma-cross example witnessing the blend-curve closed form
AI-generated sequencer code assumes GAMMA_CROSS is the naive linear mix; it blends in a gamma-0.5 space and the mid dips 0.115 below the sRGB lerp. Per-frame sample renders pin the closed form ((1-t)*sqrt(A)+t*sqrt(B))^2 with t=(frame-start)/duration — never 1 inside the effect — on both versions. Documents the AgX-default sampling trap that poisons pixel witnesses and the orphan-delete of effects whose inputs are removed first. Signed-off-by: fOuttaMyPaint <TMhospitalitystrategies@gmail.com>
1 parent 79bdde7 commit 598c6a3

12 files changed

Lines changed: 1186 additions & 4 deletions

File tree

.cursor-plugin/plugin.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"examples/uv-layer-grid",
8787
"examples/vertex-weight-limit",
8888
"examples/vse-cut-list",
89+
"examples/vse-gamma-cross",
8990
"examples/wave-displace"
9091
]
9192
}

.github/workflows/blender-smoke.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,3 +427,13 @@ jobs:
427427
# re-imported rig. Exits non-zero on failure.
428428
xvfb-run -a "$BLENDER" --background \
429429
--python examples/gltf-skin-roundtrip/gltf_skin_roundtrip.py --
430+
431+
- name: Shipped example - VSE gamma cross (blend-curve closed form)
432+
run: |
433+
set -euo pipefail
434+
# Check only: renders tiny frames across a GAMMA_CROSS and asserts
435+
# every sample against the gamma-0.5 closed form ((1-t)*sqrt(A) +
436+
# t*sqrt(B))^2 with t = (frame-start)/duration, plus the material
437+
# lerp deviation at mid. Exits non-zero on failure.
438+
xvfb-run -a "$BLENDER" --background \
439+
--python examples/vse-gamma-cross/vse_gamma_cross.py --

README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</p>
1919

2020
<p align="center">
21-
<strong>12 skills</strong> &nbsp;&bull;&nbsp; <strong>6 rules</strong> &nbsp;&bull;&nbsp; <strong>2 templates</strong> &nbsp;&bull;&nbsp; <strong>17 snippets</strong> &nbsp;&bull;&nbsp; <strong>28 examples</strong>
21+
<strong>12 skills</strong> &nbsp;&bull;&nbsp; <strong>6 rules</strong> &nbsp;&bull;&nbsp; <strong>2 templates</strong> &nbsp;&bull;&nbsp; <strong>17 snippets</strong> &nbsp;&bull;&nbsp; <strong>29 examples</strong>
2222
</p>
2323

2424
<p align="center">
@@ -36,7 +36,7 @@
3636

3737
## Overview
3838

39-
This repository ships **12 skills, 6 rules, 2 templates, 17 snippets, and 28 runnable examples** for Blender Python development targeting Blender 5.1 (current stable) with Blender 4.5 LTS fallback support.
39+
This repository ships **12 skills, 6 rules, 2 templates, 17 snippets, and 29 runnable examples** for Blender Python development targeting Blender 5.1 (current stable) with Blender 4.5 LTS fallback support.
4040

4141
The content is consumed by AI coding agents (Cursor, Claude Code, any MCP-capable client) when working on Blender add-ons, geometry nodes scripts, batch pipelines, or animation tooling. There is no build step. Edit the markdown and Python files directly.
4242

@@ -186,7 +186,7 @@ byte images stay straight 8-bit. Also witnesses `EXR color_mode='RGB'` dropping
186186
</details>
187187

188188
<details>
189-
<summary><strong>Mesh, curves &amp; text</strong> — 8 examples</summary>
189+
<summary><strong>Mesh, curves &amp; text</strong> — 9 examples</summary>
190190

191191
<table>
192192
<tr>
@@ -306,6 +306,22 @@ ending in `length=` vs `frame_end=`, and `left_handle`/`right_handle`/`duration`
306306
the deprecated `frame_final_*`. Asserts closed-form spans, GC wiring and clamping, the
307307
consumed-input compositing contract, and a save/reload round-trip.
308308

309+
</td>
310+
</tr>
311+
<tr>
312+
<td width="46%" valign="middle">
313+
<a href="examples/vse-gamma-cross/"><img src="examples/vse-gamma-cross/preview.webp" alt="VSE gamma cross: a mixing bench in a dark studio - eight emissive panels fading crimson to teal across the cross, with the brighter naive-lerp midpoint framed in hazard orange on the console below" /></a>
314+
</td>
315+
<td valign="middle">
316+
317+
### [vse-gamma-cross](examples/vse-gamma-cross/)
318+
319+
The GAMMA_CROSS fade is not the naive linear mix: it blends in a gamma-0.5
320+
space, `((1-t)·√A + t·√B)²` with `t = (frame − start) / duration` — never 1
321+
inside the effect. Per-frame sample renders assert the closed form (mid dips
322+
0.115 below the sRGB lerp), and the AgX-default sampling trap is documented
323+
(`view_transform = 'Standard'` is mandatory for any pixel witness).
324+
309325
</td>
310326
</tr>
311327
</table>

ROADMAP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Not committed; target list for the next content version. (v0.3.0 shipped the smo
110110
- UV-handle lifetime snippet: re-fetch attribute/UV layers by name after any CustomData-reallocating call (`calc_tangents`, `VertexGroup.add`, modifier edits) — held handles dangle silently on 4.5, survive by luck on 5.1 (found authoring `triangulate-tangents`)
111111
- glTF skinned-mesh export witness: follow-up to `gltf-export-roundtrip` + `vertex-weight-limit`**SHIPPED** as `examples/gltf-skin-roundtrip/``skins[0].joints` names every bone, JOINTS_0/WEIGHTS_0 with unit sums (3e-8), weights bit-exact, rest matrices to 2.4e-07, deformation to 4.8e-07; exporter welds duplicate loops (sorted-multiset comparisons mispair — compare by rest-key); unparented skinned meshes make the exporter bind an armature by name
112112
- Degenerate-bevel weld hazard (snippet or rule): bevel width ≥ half a box dimension creates zero-area faces whose loops weld on glTF export (found authoring `gltf-export-roundtrip`, where the count check caught a 36-vertex weld)
113-
- GAMMA_CROSS blend-curve witness: the cross blend is not the naive linear mix (mid-cross measured (0.341, 0.349, 0.463) from crimson (0.85, 0.10, 0.22) and teal (0.06, 0.75, 0.80)) — derive and assert the gamma-space closed form per frame; follow-up to `vse-cut-list`
113+
- ~~GAMMA_CROSS blend-curve witness~~ **SHIPPED** as `examples/vse-gamma-cross/`the cross blends in a gamma-0.5 space: `((1-t)·√A + t·√B)²` with `t = (frame − start)/duration`, never 1 inside the effect; mid-cross dips 0.115 below the sRGB lerp from crimson/teal (closed form (0.341, 0.349, 0.463) confirmed per frame); AgX-default sampling poisons the fit (0.146 red-channel error, `view_transform='Standard'` mandatory); deleting a consumed input orphans-and-deletes the effect — follow-up to `vse-cut-list`
114114
- Falsy `bpy_prop_collection` trap snippet: an empty collection is falsy, so `editor.strips or editor.sequences` silently falls through to the legacy accessor on an empty timeline — always branch on `hasattr`; likely generalizes across the API (found authoring `vse-cut-list`)
115115

116116
## Future (uncommitted)
9.88 KB
Loading
36.1 KB
Loading

docs/gallery/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,17 @@ <h2><a href="gltf-skin-roundtrip/">gltf-skin-roundtrip</a></h2>
513513
<a class="card-link" href="gltf-skin-roundtrip/">View example <span aria-hidden="true">&rarr;</span></a>
514514
</div>
515515
</article>
516+
<article class="card" data-tags="sequencer rendering">
517+
<a class="card-media" href="vse-gamma-cross/" aria-label="vse-gamma-cross example detail page">
518+
<img src="assets/vse-gamma-cross-hero.webp" alt="vse-gamma-cross — The GAMMA_CROSS fade is not the naive linear mix: it blends in a gamma-0.5 space, so the mid-cross dips below the sRGB lerp." loading="lazy" decoding="async" />
519+
</a>
520+
<div class="card-body">
521+
<h2><a href="vse-gamma-cross/">vse-gamma-cross</a></h2>
522+
<p class="teaches">The GAMMA_CROSS fade is not the naive linear mix: it blends in a gamma-0.5 space, so the mid-cross dips below the sRGB lerp. Tiny per-frame renders are asserted against the closed form per frame.</p>
523+
<p class="witnesses"><span class="tag">witnesses</span> out = ((1-t)*sqrt(A) + t*sqrt(B))^2 with t = (frame - start) / duration, never 1 inside the effect. The mid lerp deviation is 0.115; AgX-default sampling poisons the fit (Standard is mandatory).</p>
524+
<a class="card-link" href="vse-gamma-cross/">View example <span aria-hidden="true">&rarr;</span></a>
525+
</div>
526+
</article>
516527
</div>
517528
</main>
518529
<footer>

0 commit comments

Comments
 (0)