IDProps mismatch (pyRNA-defined vs. custom props) can confuse liboverride system in Collection property case #92518

Open
opened 2021-10-27 04:23:27 +02:00 by Tal Hershkovich · 7 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 398.36

Blender Version
Broken: version: 2.93.5, branch: master, commit date: 2021-10-05 12:04, hash: a791bdabd0

Short description of error
Override libraries linking seem to have an issue when linking collection property registered by an addon or a script.
If I add items to a collection property of an object in the source file, and then link the object using override libraries in a new file. I can't delete this item in the collection property, that's ok. The problem is when I go back to the source file and clear the collection property, so it doesn't have items anymore, then going back again to the linked file,the object still has this property item, even if it was deleted in the source file, and it still can't be removed.

Exact steps for others to reproduce the error
The rar file includes a source file, a file with the linked collection, and a test addon which just register a property, you can also just run the script from the source file, but better to test with the addon.

  • Install the addon or run the script in order to register a collection property called test_proprety on the box object.
  • Open the file override_properties_to_link.blend
  • Select cube and Write in the console C.object.test_property.items() or just press the arrow up in the console
  • There should be one item assigned - bpy.data.objects['Cube'].test_property[0])
  • Try to clear using C.object.test_property.clear() and then check the items again. The item is still there for me and can't be removed, also when using remove(0).
  • Go to the source file and check for the items again using C.object.test_property.items(). It should be empty.

How to repeat the error?

  • In the source file add items to the object property using C.object.test_property.add()
  • Start a new clean file, link the collection from the source file.
  • Make the cube object a library override.
  • The object should have the item in the C.object.test_property from the source file. Save the file.
  • Go back to the source file and clear the items using C.object.test_property.clear() and save the source again.
  • Open the saved file with the linked source. Run C.object.test_property.items() in the console, and it will still have the item that was cleared from the source.

Override_property_Bug.rar

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 398.36 **Blender Version** Broken: version: 2.93.5, branch: master, commit date: 2021-10-05 12:04, hash: `a791bdabd0` **Short description of error** Override libraries linking seem to have an issue when linking collection property registered by an addon or a script. If I add items to a collection property of an object in the source file, and then link the object using override libraries in a new file. I can't delete this item in the collection property, that's ok. **The problem is when I go back to the source file and clear the collection property,** so it doesn't have items anymore, then going back again to the linked file,**the object still has this property item,** even if it was deleted in the source file, and it still can't be removed. **Exact steps for others to reproduce the error** The rar file includes a source file, a file with the linked collection, and a test addon which just register a property, you can also just run the script from the source file, but better to test with the addon. - Install the addon or run the script in order to register a collection property called test_proprety on the box object. - Open the file override_properties_to_link.blend - Select cube and Write in the console C.object.test_property.items() or just press the arrow up in the console - There should be one item assigned - bpy.data.objects['Cube'].test_property[0]) - Try to clear using C.object.test_property.clear() and then check the items again. The item is still there for me and can't be removed, also when using remove(0). - Go to the source file and check for the items again using C.object.test_property.items(). It should be empty. How to repeat the error? - In the source file add items to the object property using C.object.test_property.add() - Start a new clean file, link the collection from the source file. - Make the cube object a library override. - The object should have the item in the C.object.test_property from the source file. Save the file. - Go back to the source file and clear the items using C.object.test_property.clear() and save the source again. - Open the saved file with the linked source. Run C.object.test_property.items() in the console, and it will still have the item that was cleared from the source. [Override_property_Bug.rar](https://archive.blender.org/developer/F11533751/Override_property_Bug.rar)

Added subscriber: @TalHershkovich

Added subscriber: @TalHershkovich

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Added subscriber: @mont29

Added subscriber: @mont29

I think the issue here is when you mix blenders with and without your addon.

IDProps can be define from python, and as regular custom properties. When you open a file with some py-defined idprops, which do not exist in current blender (because e.g. addon defining those is not enabled or active), they get 'converted' to regular IDProps... Think the issue comes from that.

Not really something we can easily work on currently, that duality of IDProps types is a nightmare to deal with anyway, would consider this more as a known issue caused by internal limitations.

I think the issue here is when you mix blenders with and without your addon. IDProps can be define from python, and as regular custom properties. When you open a file with some py-defined idprops, which do not exist in current blender (because e.g. addon defining those is not enabled or active), they get 'converted' to regular IDProps... Think the issue comes from that. Not really something we can easily work on currently, that duality of IDProps types is a nightmare to deal with anyway, would consider this more as a known issue caused by internal limitations.
Bastien Montagne changed title from Collection property item can't be removed with library overrides after being cleared from source file. to IDProps mismatch (pyRNA-defined vs. custom props) can confuse liboverride system in Collection property case 2021-10-27 14:22:01 +02:00

Note that I cannot reproduce that issue from scratch if I keep using a blender with your addon enabled all the time.

Note that I cannot reproduce that issue from scratch if I keep using a blender with your addon enabled all the time.

In #92518#1242470, @mont29 wrote:
Note that I cannot reproduce that issue from scratch if I keep using a blender with your addon enabled all the time.

That's strange because it actually happens to me when I do keep the addon turned on all the time. When I turn the addon off and restart Blender then it's actually solving the problem and the "ghost" property is removed.
Did you

  • add items to the property in the source file and saved
  • opened the file with the object linked and saved it as well (Maybe try to add also more items to the property in this file as well)
  • open back the source file and clear the items
  • re-open the link file and try to clear all items

When you use the addon and load the linked file that I've attached, can you actually see the "ghost" item of the property in the console ?

> In #92518#1242470, @mont29 wrote: > Note that I cannot reproduce that issue from scratch if I keep using a blender with your addon enabled all the time. That's strange because it actually happens to me when I do keep the addon turned on all the time. When I turn the addon off and restart Blender then it's actually **solving** the problem and the "ghost" property is removed. Did you - add items to the property in the source file and saved - opened the file with the object linked and saved it as well (Maybe try to add also more items to the property in this file as well) - open back the source file and clear the items - re-open the link file and try to clear all items When you use the addon and load the linked file that I've attached, can you actually see the "ghost" item of the property in the console ?

Added subscriber: @timodriaan

Added subscriber: @timodriaan
Philipp Oeser removed the
Interest
Core
label 2023-02-09 14:42:54 +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
4 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#92518
No description provided.