Overrides: Overridable Python Properties don't get saved #115941

Closed
opened 2023-12-08 13:36:28 +01:00 by Demeter Dzadik · 4 comments
Member

System Information
Operating system: Linux-6.6.4-gentoo-x86_64-Intel-R-_Core-TM-i9-9900K_CPU@_3.60GHz-with-glibc2.37 64 Bits, X11 UI
Graphics card: NVIDIA GeForce RTX 2080/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 545.29.06

Blender Version
Broken: version: 4.1.0 Alpha, branch: main, commit date: 2023-12-08 00:25, hash: 2b0448c91d7a

Repro

  • Download both files and place side-by-side:
    python_property_override_test_linked.blend
    python_property_override_test.blend
  • Open _linked.blend.
  • A short script auto-registers a sidebar panel called "My Category".
  • In it, you see the armature's bone collections, with a Python BoolProperty that was registered on bpy.types.BoneCollection
  • Edit the toggles
  • Save & Reload
  • Your changes get lost.

CC @mont29 Any ideas?

**System Information** Operating system: Linux-6.6.4-gentoo-x86_64-Intel-R-_Core-TM-_i9-9900K_CPU_@_3.60GHz-with-glibc2.37 64 Bits, X11 UI Graphics card: NVIDIA GeForce RTX 2080/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 545.29.06 **Blender Version** Broken: version: 4.1.0 Alpha, branch: main, commit date: 2023-12-08 00:25, hash: `2b0448c91d7a` **Repro** - Download both files and place side-by-side: [python_property_override_test_linked.blend](/attachments/47710414-16b2-4d20-ba56-9c9c8f93cbad) [python_property_override_test.blend](/attachments/175b634c-96a1-4237-812f-7fc8fd383c86) - Open _linked.blend. - A short script auto-registers a sidebar panel called "My Category". - In it, you see the armature's bone collections, with a Python BoolProperty that was registered on bpy.types.BoneCollection - Edit the toggles - Save & Reload - Your changes get lost. CC @mont29 Any ideas?
Demeter Dzadik added the
Type
Report
Priority
Normal
Status
Needs Triage
labels 2023-12-08 13:36:29 +01:00
Author
Member

Sorry, I don't think this is specific to BoneCollections, seems to happen for properties registered on bpy.types.Object too. Edited task accordingly.

Sorry, I don't think this is specific to BoneCollections, seems to happen for properties registered on bpy.types.Object too. Edited task accordingly.
Demeter Dzadik changed title from Overrides/BoneCollections: Overridable Python Properties don't get saved to Overrides: Overridable Python Properties don't get saved 2023-12-08 14:14:37 +01:00

This won´t work for sure if you do not set the my_pointer to be overridable as well:

    bpy.types.BoneCollection.my_pointer = bpy.props.PointerProperty(type=MyElement, override={'LIBRARY_OVERRIDABLE'})

But I think the main issue comes from the fact that this RNA data is created by the script when opening the library file, so from blender PoV, that data does not exists before that point, and is not read?
Would need more time (which I do not have right now) to investigate and be sure, but would (very strongly) recommend ensuring all expected data model to exist before loading any override. LibOverrides are fully based on RNA data model. Working around it may be possible, either with existing code of adding more trickery to it, but I highly doubt this would lead to any reliable solution.

This won´t work for sure if you do not set the `my_pointer` to be overridable as well: ``` bpy.types.BoneCollection.my_pointer = bpy.props.PointerProperty(type=MyElement, override={'LIBRARY_OVERRIDABLE'}) ``` But I think the main issue comes from the fact that this RNA data is created by the script when opening the library file, so from blender PoV, that data does not exists before that point, and is not read? Would need more time (which I do not have right now) to investigate and be sure, but would (very _strongly_) recommend ensuring all expected data model to exist _before_ loading any override. LibOverrides are fully based on RNA data model. Working around it may be possible, either with existing code of adding more trickery to it, but I highly doubt this would lead to any reliable solution.

But I think the main issue comes from the fact that this RNA data is created by the script when opening the library file, so from blender PoV, that data does not exists before that point, and is not read?

To be more specific, it would be read as 'vanilla' IDProperty, without any RNA information behind it, so the RNA paths it was 'saved' with by liboverride would be invalid.


One possible workaround could be to try and reload the library a second time afterwards, but this could actually lead to other issues (like attempt to re-register the RNA props a second time, ...).

> But I think the main issue comes from the fact that this RNA data is created by the script when opening the library file, so from blender PoV, that data does not exists before that point, and is not read? To be more specific, it would be read as 'vanilla' IDProperty, without any RNA information behind it, so the RNA paths it was 'saved' with by liboverride would be invalid. ------------- One possible workaround could be to try and reload the library a second time afterwards, but this could actually lead to other issues (like attempt to re-register the RNA props a second time, ...).
Author
Member

set the my_pointer to be overridable as well

That... works...! Sorry...! 😅 Ignore me, have a nice day, thank you 🙏

> set the my_pointer to be overridable as well That... works...! Sorry...! 😅 Ignore me, have a nice day, thank you 🙏
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2023-12-08 15:31:44 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#115941
No description provided.