Skip to content

Commit 8bc4f5e

Browse files
feat: witness VSE use_linear_modifiers removal across 4.5, 5.1, and 5.2
Naive getattr still works on 4.5.11 and 5.1.2 and raises AttributeError on 5.2.1. Version-guarded hasattr then read exits 0 on all three; --assume-present is red only where the RNA is gone. Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 8e3495c commit 8bc4f5e

8 files changed

Lines changed: 233 additions & 7 deletions

File tree

‎.cursor-plugin/plugin.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
"examples/vertex-weight-limit",
132132
"examples/vse-cut-list",
133133
"examples/vse-gamma-cross",
134+
"examples/vse-linear-modifiers",
134135
"examples/wave-displace"
135136
]
136137
}

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ a `.cursor-plugin/plugin.json` manifest so the ecosystem drift checker
2020
classifies it as a `cursor-plugin`. This is content the AI loads when the user
2121
asks Blender questions or works on Blender add-ons in Cursor or Claude Code.
2222

23-
The content base is 16 skills, 9 rules, 3 templates, 27 snippets, and 55
23+
The content base is 16 skills, 9 rules, 3 templates, 27 snippets, and 56
2424
examples (counts are CI-enforced against README.md and the manifest). The full
2525
inventory tables and per-item purposes live in `CLAUDE.md`. Example anatomy
2626
and authoring rules: copy `examples/bmesh-gear/`; the render look is specified

‎CLAUDE.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ skills/<skill-name>/SKILL.md - AI workflow definitions, 16 total
2121
rules/<rule-name>.mdc - Anti-pattern rules, 9 total
2222
templates/<template-name>/ - Starter projects, 3 total
2323
snippets/<snippet-name>.py - Standalone code patterns, 27 total
24-
examples/<name>/ - Runnable smoke-gated examples, 55 total (+ gallery.json)
24+
examples/<name>/ - Runnable smoke-gated examples, 56 total (+ gallery.json)
2525
scripts/build_gallery.py - Regenerates docs/gallery/ from gallery.json (stdlib only)
2626
scripts/site/ - Vendored landing-page build (Jinja2)
2727
docs/gallery/ - Committed generated gallery pages + hero renders
@@ -99,7 +99,7 @@ v0.2.0: Principled BSDF material, driver-with-custom-function via `driver_namesp
9999

100100
AI asset pipeline track: `decimate_to_budget.py`, `convex_hull_collider.py`, `lod_chain.py` (helper duplicated, not imported), `gltf_draco_export.py`, `export_preset_unity.py`, `export_preset_godot.py`, `export_preset_unreal.py`, `setup_bake_target_image.py`, `bake_normal_high_to_low.py`, `save_baked_image.py`.
101101

102-
## Examples (55)
102+
## Examples (56)
103103

104104
Runnable scripts at `examples/<name>/`, each asserting a real API contract with
105105
deterministic checks (exit non-zero on failure) and optionally rendering a still via

‎README.md‎

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

2020
<p align="center">
21-
<strong>16 skills</strong> &nbsp;&bull;&nbsp; <strong>9 rules</strong> &nbsp;&bull;&nbsp; <strong>3 templates</strong> &nbsp;&bull;&nbsp; <strong>27 snippets</strong> &nbsp;&bull;&nbsp; <strong>55 examples</strong>
21+
<strong>16 skills</strong> &nbsp;&bull;&nbsp; <strong>9 rules</strong> &nbsp;&bull;&nbsp; <strong>3 templates</strong> &nbsp;&bull;&nbsp; <strong>27 snippets</strong> &nbsp;&bull;&nbsp; <strong>56 examples</strong>
2222
</p>
2323

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

3737
## Overview
3838

39-
This repository ships **16 skills, 9 rules, 3 templates, 27 snippets, and 55 examples** for Blender Python development targeting Blender 5.2 LTS (current stable) with Blender 4.5 LTS fallback support. Blender 5.1 is prior stable.
39+
This repository ships **16 skills, 9 rules, 3 templates, 27 snippets, and 56 examples** for Blender Python development targeting Blender 5.2 LTS (current stable) with Blender 4.5 LTS fallback support. Blender 5.1 is prior stable.
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

@@ -203,7 +203,7 @@ Gallery still is a dual-elevation diptych so the contract reads at thumbnail sca
203203
</details>
204204

205205
<details>
206-
<summary><strong>Mesh, curves &amp; text</strong> — 11 examples</summary>
206+
<summary><strong>Mesh, curves &amp; text</strong> — 12 examples</summary>
207207

208208
<table>
209209
<tr>
@@ -370,6 +370,20 @@ inside the effect. Per-frame sample renders assert the closed form (mid dips
370370
0.115 below the sRGB lerp), and the AgX-default sampling trap is documented
371371
(`view_transform = 'Standard'` is mandatory for any pixel witness).
372372

373+
</td>
374+
</tr>
375+
<tr>
376+
<td width="46%" valign="middle">
377+
check-only, no gallery still — no geometry
378+
</td>
379+
<td valign="middle">
380+
381+
### [vse-linear-modifiers](examples/vse-linear-modifiers/)
382+
383+
`ColorStrip.use_linear_modifiers` is a bool on 4.5.11 and 5.1.2; the same
384+
getattr is `AttributeError` on 5.2.1. Version-guarded `hasattr` then read
385+
exits 0 on all three. `--assume-present` is red only on 5.2.
386+
373387
</td>
374388
</tr>
375389
</table>

‎ROADMAP.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ Not committed; target list for the next content version. (v0.3.0 shipped the smo
140140
- ~~Vertex-colour AO witness~~ **SHIPPED** as `examples/vertex-color-ao/` — baked occlusion in a colour attribute on a stone village well, checked against a closed form rather than a captured value: the cosine-weighted hemisphere integral for an infinitely wide wall of height H at distance d is `AO = 1 − ½(1 − 1/√(1+k²))`, `k = H/d`, matched to **6.760e-04** across k = 60.0…0.60 (gate 2.5e-03, QMC noise ~1/√n at 4096 samples); unoccluded plate bakes to **exactly 1.0**; strictly monotone 0.508301 → 0.928467; asset values in [0,1] with spread 1.0; **`BYTE_COLOR` is sRGB-encoded 8-bit, not linear** (0.735 → 0.7379107, peak round-trip error 3.782e-03, matching an independent encode/quantise/decode model to 3.189e-07) while `FLOAT_COLOR` is exact; both survive depsgraph evaluation at deviation 0.0; `bmesh.ops.bevel` offsets along **cached** face normals and flips outward past 90° of staleness (12 mm below ground on a ring of boxes, fixed by `normal_update()`); point-domain AO needs subdivision or the crevice gradient never reaches the attribute; `color_attributes` enumeration order differs between 4.5.11 and 5.1.2 — look up by name; byte-identical on 4.5.11 and 5.1.2 (6966 verts)
141141
- ~~High-to-low tangent normal bake~~ **SHIPPED** as `examples/bake-normal-high-to-low/` — Cycles CPU `type='NORMAL'` cage bake onto a `DECIMATE COLLAPSE` hatch; statistical gates (detail frac 0.7211 / MAD 0.09356 vs flat 0.0000 / 0.00277); `--flat-source` exits 5; RNA identical on 4.5.11, 5.1.2, 5.2.1; byte-identity is not the contract
142142
- UV atlas **utilization** witness — coverage/wasted-texel closed forms for a packed lightmap atlas (the non-overlap, unit-square, margin, and active/active_render contracts shipped in `lightmap-uv-channel`; utilization is the remaining unbuilt slice of the old "UV atlas pack" candidate)
143+
- ~~VSE `use_linear_modifiers` removal~~ **SHIPPED** as `examples/vse-linear-modifiers/` — bool on 4.5.11 and 5.1.2, `AttributeError` on 5.2.1; `--assume-present` red only on 5.2; pathology, no gallery still
144+
- GN evaluated `to_mesh().name` no longer equals the original mesh name (5.2 contract change)
145+
- `MeshAutomaskingSettings` move: old `Brush` automasking attributes gone on 5.2
143146
- ~~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`
144147
- 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`)
145148
- ~~Collision compound witness~~ **SHIPPED** as `examples/collision-hull-proxy/` — game-prop collision as a compound of convex pieces, each a `bmesh.ops.convex_hull` of a coarse `sec(π/n)`-inflated cage (containment 4.4e-08, watertight, positive signed volume, Euler 2, per-piece 255-face budget: body 70, caps 60×3, compound 250); a hull of the dense render mesh measures 380 faces — over budget — which is why pipelines hull cages; proud details cost cage rows, concave grooves are free; byte-identical on 4.5.11 and 5.1.2
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# VSE linear modifiers attribute
2+
3+
Pathology witness for the 5.2 removal of `Sequence.use_linear_modifiers`.
4+
A COLOR strip is enough; there is no geometry and **no gallery still**
5+
(same class as [`exit-pre-sidecar`](../exit-pre-sidecar/),
6+
[`ngon-triangulate`](../ngon-triangulate/)).
7+
8+
Follows [`vse-python`](../../skills/vse-python/SKILL.md) and the
9+
version-gated assertion shape of
10+
[`gn-modifier-inputs`](../gn-modifier-inputs/) (per-version contract, exit
11+
0 on every matrix leg). Scaffolding matches
12+
[`cross-version-property-delete`](../cross-version-property-delete/)
13+
(`check()` returns, argparse naive-API flag, FATAL wrapper). That example
14+
does **not** version-branch — `del` is the same on 4.5 and 5.x — so the
15+
gate itself is copied from `gn-modifier-inputs`, not from `del`.
16+
17+
**What it witnesses:** `ColorStrip.use_linear_modifiers` is a bool you can
18+
set on 4.5.11 and 5.1.2. The same getattr/setattr is `AttributeError` on
19+
5.2.1. `hasattr` then read never raises on any of the three.
20+
21+
**What failure each check would catch:**
22+
23+
- exit 3 — COLOR strip never landed
24+
- exit 4 — attribute missing where the naive/legacy path requires it
25+
(`--assume-present` on 5.2 lands here)
26+
- exit 5 — attribute still present, or getattr silent, on 5.2+
27+
- exit 6 — setattr did not round-trip on 4.5 / 5.1
28+
- exit 7 — the `hasattr` guard still raised
29+
30+
`--assume-present` is the falsifier: skip the version gate and demand the
31+
4.5 RNA. It exits **0 on 4.5.11 and 5.1.2** (the old API still works) and
32+
**4 on 5.2.1**. That is unlike `--same-axis`, which is red on every
33+
binary.
34+
35+
No `SMOKE_SKIP`. Every matrix leg exercises the contract.
36+
37+
## Run
38+
39+
```bash
40+
blender --background --python vse_linear_modifiers.py --
41+
blender --background --python vse_linear_modifiers.py -- --assume-present
42+
```
43+
44+
## Exit codes
45+
46+
Per-script sequential checks. `9` is a valid check code; there is no rule
47+
against it.
48+
49+
| Code | Meaning |
50+
| --- | --- |
51+
| 0 | Success |
52+
| 1 | Uncaught exception (FATAL wrapper) |
53+
| 2 | argparse / usage |
54+
| 3 | COLOR strip was not created |
55+
| 4 | `use_linear_modifiers` missing when required (`--assume-present` on 5.2) |
56+
| 5 | Attribute still present or getattr silent on 5.2+ |
57+
| 6 | setattr round-trip failed |
58+
| 7 | `hasattr`-guarded read raised |
59+
60+
The `blender-smoke` workflow runs the check on Blender 5.2 LTS and 4.5 LTS
61+
(5.1 on the weekly cron, the `needs-5.1` PR label, or manual dispatch).
62+
Smoke does not pass `--assume-present`.
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
"""VSE strip.use_linear_modifiers removal — a runnable example.
2+
3+
Witnesses the 5.2 removal of ``Sequence.use_linear_modifiers``. Access is a
4+
bool on 4.5 LTS and 5.1; the same getattr/setattr raises AttributeError on
5+
5.2. Version-guarded code (``hasattr`` then read) does not raise on any of
6+
the three. Pathology: no geometry, no gallery still.
7+
8+
The default path asserts the behavior that is correct for *this* Blender —
9+
present-and-bool below 5.2, AttributeError on 5.2+ — and still exits 0 on
10+
all three. ``--assume-present`` is the naive script: read the attribute
11+
unconditionally. That is red only on 5.2, where the attribute is gone.
12+
13+
blender --background --python vse_linear_modifiers.py --
14+
blender --background --python vse_linear_modifiers.py -- --assume-present
15+
"""
16+
import argparse
17+
import sys
18+
19+
import bpy
20+
21+
ATTR = "use_linear_modifiers"
22+
REMOVED_AT = (5, 2, 0)
23+
24+
25+
def fail(msg, code):
26+
print(f"ERROR: {msg}", file=sys.stderr)
27+
return code
28+
29+
30+
def strips_coll(se):
31+
return se.strips if hasattr(se, "strips") else se.sequences
32+
33+
34+
def new_color(coll, name, channel, start, length):
35+
"""COLOR strip covering [start, start+length) — version-correct end kwarg."""
36+
if bpy.app.version >= (5, 0, 0):
37+
return coll.new_effect(
38+
name=name, type="COLOR", channel=channel,
39+
frame_start=start, length=length,
40+
)
41+
return coll.new_effect(
42+
name=name, type="COLOR", channel=channel,
43+
frame_start=start, frame_end=start + length,
44+
)
45+
46+
47+
def guarded_read(strip):
48+
"""Version-safe reader: never raises. None means the RNA is gone."""
49+
if hasattr(strip, ATTR):
50+
return getattr(strip, ATTR)
51+
return None
52+
53+
54+
def check(strip, assume_present=False):
55+
ver = bpy.app.version
56+
legacy = ver < REMOVED_AT
57+
require_present = assume_present or legacy
58+
print(
59+
f"blender={ver} assume_present={assume_present} "
60+
f"legacy={legacy} require_present={require_present}"
61+
)
62+
63+
present = hasattr(strip, ATTR)
64+
print(f"hasattr_{ATTR}={present}")
65+
66+
if require_present:
67+
if not present:
68+
return fail(
69+
f"{ATTR} missing on {ver} — naive/legacy path requires it",
70+
4,
71+
)
72+
try:
73+
val = getattr(strip, ATTR)
74+
except AttributeError as exc:
75+
return fail(f"{ATTR} getattr raised on {ver}: {exc}", 4)
76+
if type(val) is not bool:
77+
return fail(f"{ATTR} is {type(val).__name__}={val!r}, not bool", 4)
78+
flipped = not val
79+
setattr(strip, ATTR, flipped)
80+
if getattr(strip, ATTR) is not flipped:
81+
return fail(f"{ATTR} setattr did not round-trip", 6)
82+
setattr(strip, ATTR, val)
83+
print(f"{ATTR}={val} round_trip_ok")
84+
else:
85+
if present:
86+
return fail(
87+
f"{ATTR} still present on {ver}; 5.2+ must have removed it",
88+
5,
89+
)
90+
try:
91+
getattr(strip, ATTR)
92+
return fail(f"{ATTR} getattr returned instead of AttributeError", 5)
93+
except AttributeError as exc:
94+
print(f"getattr AttributeError={exc}")
95+
96+
try:
97+
guarded = guarded_read(strip)
98+
except AttributeError as exc:
99+
return fail(f"hasattr-guarded read still raised: {exc}", 7)
100+
print(f"guarded_read={guarded!r}")
101+
if require_present and guarded is None:
102+
return fail("guarded read returned None while the attribute exists", 7)
103+
if not require_present and guarded is not None:
104+
return fail("guarded read returned a value on 5.2+", 7)
105+
return 0
106+
107+
108+
def build():
109+
bpy.ops.wm.read_factory_settings(use_empty=True)
110+
scene = bpy.context.scene
111+
se = scene.sequence_editor_create()
112+
coll = strips_coll(se)
113+
strip = new_color(coll, "ProbeColor", channel=1, start=1, length=24)
114+
return strip
115+
116+
117+
def main():
118+
argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []
119+
p = argparse.ArgumentParser()
120+
p.add_argument(
121+
"--assume-present",
122+
action="store_true",
123+
help="falsification: read use_linear_modifiers as if it still exists",
124+
)
125+
args = p.parse_args(argv)
126+
127+
strip = build()
128+
if strip is None or strip.bl_rna.identifier != "ColorStrip":
129+
return fail("COLOR strip was not created", 3)
130+
131+
code = check(strip, assume_present=args.assume_present)
132+
if code:
133+
return code
134+
print("vse-linear-modifiers OK")
135+
return 0
136+
137+
138+
if __name__ == "__main__":
139+
try:
140+
sys.exit(main())
141+
except Exception as e:
142+
import traceback
143+
traceback.print_exc()
144+
print(f"FATAL: {e}", file=sys.stderr)
145+
sys.exit(1)

‎tests/smoke/catalog.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,6 @@
6969
{"name": "ngon-triangulate", "script": "examples/ngon-triangulate/ngon_triangulate.py"},
7070
{"name": "unapplied-scale-gltf", "script": "examples/unapplied-scale-gltf/unapplied_scale_gltf.py"},
7171
{"name": "coincident-vert-weld", "script": "examples/coincident-vert-weld/coincident_vert_weld.py"},
72-
{"name": "bake-normal-high-to-low", "script": "examples/bake-normal-high-to-low/bake_normal_high_to_low.py"}
72+
{"name": "bake-normal-high-to-low", "script": "examples/bake-normal-high-to-low/bake_normal_high_to_low.py"},
73+
{"name": "vse-linear-modifiers", "script": "examples/vse-linear-modifiers/vse_linear_modifiers.py"}
7374
]

0 commit comments

Comments
 (0)