Repository navigation
fix(skills): document that registered props are not ID properties on 5.0+ - #420
Merged
Merged
Conversation
…5.0+ On 4.x a registered bpy.props value was stored as an ID property, so scene["my_prop"], "my_prop" in scene.keys(), del scene["my_prop"] and a '["my_prop"]' driver path all reached it. On 5.0+ it lives in a separate system-property group and every one of those raises KeyError/ValueError or silently misses it (measured on 4.5.11, 5.1.2, 5.2.1). Legacy add-on code and AI-written code break here without a clear error, and the custom-properties skill called its operations "version-stable". custom-properties now has the measured table and the branch-free recipe (attribute access, property_unset, is_property_set, plain data path), plus a common-mistakes entry; drivers-and-app-handlers distinguishes '["custom"]' from a registered prop's plain path; the delete snippet warns that del id["registered"] raises on 5.0+. examples/cross-version-property-delete proves it in CI: a new registered-prop check (exit 8) runs on every version, and a new --subscript-registered falsifier (min_version 5.0) reads the prop the 4.x way and must exit 8. Closes #354 Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
CI evidence before merge: all checks pass ( 13 pass ). Blender Smoke on PR head: Blender 5.2.2 LTS / Blender 4.5.14 LTS. Summaries (happy path; falsifiers) per leg: 141 passed, 3 skipped, 0 failed;136 passed, 7 skipped, 0 failed;143 passed, 1 skipped, 0 failed;143 passed, 0 skipped, 0 failed; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #354.
Problem
On 4.x a registered
bpy.propsvalue was stored as an ID property. On 5.0+ it isn't, so the 4.x idioms break with aKeyErrororValueError, or silently miss the property. The custom-properties skill called its operations "version-stable" and never mentioned this.Measured
Live run (
--factory-startup),bpy.types.Scene.p = IntProperty(default=1);scene.p = 5. Binaries report 4.5.11 LTS, 5.1.2 and 5.2.1 LTS:scene.pscene["p"]scene.get("p")"p" in scene.keys()del scene["p"]path_resolve('["p"]')(driver path)path_resolve("p"),property_unset,is_property_setbl_system_properties_getA
.blendsaved by 4.5.11 (value 9) opens in 5.2.1 withscene.p == 9.Change
custom-properties:property_unset,is_property_set, plain path;del id["registered"]is not a reset.drivers-and-app-handlers:data_pathnow distinguishes'["custom"]'(an ID property) from a registered prop's plain name.snippets/cross-version-property-delete.py: warns about the reverse case (32 lines).examples/cross-version-property-delete:check_registered(), run on every version: asserts which side of the split the prop sits on, that attribute access and plain paths work, and thatproperty_unsetresets it; exit 8;--subscript-registered, which readsscene["bdt_counter"]the 4.x way;min_version: "5.0";Evidence (live run, three versions)
in_keys=True split=False)in_keys=False split=True)--subscript-registeredmin_version)KeyError … read it as scene.bdt_counter)--skip-delete(existing)check_smoke_catalog,check_exit_code_readme,check_falsifier_targets,check_skill_refsandcheck_site_linkspass.--outputrender path.check_registered()touches only a temporary Scene property, which it unregisters infinally, and the still is driven by the lamps'keys(), which are unchanged.🤖 Generated with Claude Code