Ensure name collisions between liboverrides and their reference data does not breaks liboverrides. #110421
Labels
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
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#110421
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The Problem
Pets production at the Blender studio as revealed an issue with library overrides, which is fairly difficult to trigger in normal usages cases, but can easily appear when production files get messy: name collision between linked reference IDs and override ones with a collection of IDs.
In practice, this is mainly affecting collections' list of objects.
At some point, given specific set of events (having several liboverrides of the same data, having several objects named the 'same' in the library file -
door
,door.00
,door.002
, etc. - and having several resyncs due to such objects being added and removed, you can end up in a situation where the override of objectdoor.004
is nameddoor.002
, and the override of objectdoor.002
is nameddoor.001
.This can lead to breakage in liboverride applying code, as at some point during the process the liboverride collection can have two objects named
door.002
, the liboverride one, and the linked one. This breaks reference of objects of a collection by their names.Two commits have already been made to alleviate the issue (
a05419f18b
ande11da03e7a
), but they only make such problem much, much less likely to happen, they cannot guarantee it will never happen again.Possible Solutions
The only way to solve this issue is to ensure that in liboverride, references to IDs within ID RNAcollections are unique and can never collide with any other ID. There can be two ways to achieve this:
.001
etc. counter by some sort of alpha-numeric UID in liboverride names.The first solution essentially introduces some concept of UUID to data-blocks, but in a poor way, potentially still brittle, and in any case fairly 'ugly' since these alphanumeric codes would be exposed everywhere in the UI.
The second solution, suggested @brecht and also discussed with @Sergey, was tried out first. From an initial analysis, it implied:
reference
andlocale
Library
pointer to theIDOverrideLibraryPropertyOperation
. Would be null, except for RNA collection items referencing linked IDs.However, it was actually not working for linked liboverrides, as libraries are always local IDs and never linked, this data is lost when linking the liboverride into another file. This could be worked around by storing the library as a file path oinstead of a pointer to the ID, however this would make the code significantly more complicated.
So instead, a weak reference to the ID pointer itself will be used (similar to how linked objects are referenced by local viewlayer's base data e.g.). This solution is very similar to using the Library pointer, with the key difference that ID pointers also work 'by definition' when linking liboverrides. Note that:
Implemented as !110773.
Committed as
6a86dd5f34
, closing.