Inconsistency with users of object datablocks and silent deletion on Unlink #113547

Open
opened 2023-10-11 16:15:16 +02:00 by Simon Thommes · 2 comments
Member

System Information
Operating system: Linux-6.5.6-gentoo-x86_64-AMD_Ryzen_9_5950X_16-Core_Processor-with-glibc2.37 64 Bits, X11 UI
Graphics card: NVIDIA RTX A6000/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 535.113.01

Blender Version
Broken: version: 4.1.0 Alpha, branch: main, commit date: 2023-10-10 22:48, hash: 61dc86b0eb65
Worked: (newest version of Blender that worked as expected)

Short description of error

There is quite some inconsistency with how references and users of objects are considered when unlinking an object from the view layer. It doesn't seem clear from the user perspective when Blender will actually delete the object, when actually pressing Unlink and the behavior for collections is different in that it will just create a fake user when it is left without other users after unlinking.

I talked about this topic with @mont29 , who told me that this is a known issue which will need a lot of UI and design consideration before it can be changed. He told me to still make this report so we could keep track of the issue and not lose it out of sight. I'm not sure how this issue should be tagged though, as it's not strictly a bug report.

The most fatal issue with all of this is that the Unlink button for objects will actually not just unlink but delete the object entirely, when there is no real user left.

One solution to this particular issue that he proposed was to grey out the Unlink button whenever it would actually delete the object. Then the user would need to explicitly press the delete button instead, rather than Blender silently removing it.

**System Information** Operating system: Linux-6.5.6-gentoo-x86_64-AMD_Ryzen_9_5950X_16-Core_Processor-with-glibc2.37 64 Bits, X11 UI Graphics card: NVIDIA RTX A6000/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 535.113.01 **Blender Version** Broken: version: 4.1.0 Alpha, branch: main, commit date: 2023-10-10 22:48, hash: `61dc86b0eb65` Worked: (newest version of Blender that worked as expected) **Short description of error** There is quite some inconsistency with how references and users of objects are considered when unlinking an object from the view layer. It doesn't seem clear from the user perspective when Blender will actually delete the object, when actually pressing `Unlink` and the behavior for collections is different in that it will just create a fake user when it is left without other users after unlinking. <video src="/attachments/4a9fe2c2-245d-4ec3-a195-f227799bc289" title="object_usage_inconsistency-2023-10-11_16.03.10.mp4" controls></video> I talked about this topic with @mont29 , who told me that this is a known issue which will need a lot of UI and design consideration before it can be changed. He told me to still make this report so we could keep track of the issue and not lose it out of sight. I'm not sure how this issue should be tagged though, as it's not strictly a bug report. The most fatal issue with all of this is that the `Unlink` button for objects will actually not just unlink but delete the object entirely, when there is no real user left. One solution to this particular issue that he proposed was to grey out the `Unlink` button whenever it would actually delete the object. Then the user would need to explicitly press the delete button instead, rather than Blender silently removing it.
Simon Thommes added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-10-11 16:15:17 +02:00

I will confirm as known issue then.

I will confirm as known issue then.
Richard Antalik added
Status
Confirmed
Type
Known Issue
Interest
Core
and removed
Status
Needs Triage
Type
Report
labels 2023-10-11 22:45:53 +02:00

I indeed think that the immediate actionable is to forbid unlinking an object from its last (instantiating) collection (instead of implicitly deleting it when doing so, which is current behavior).

On the long run, removing these special handling for objects is a nice goal, but it indeed requires quite some careful UI/UX design:

All Local Objects Must Be Instantiated

Currently, all local objects have to be instantiated in at least one scene, This is done for historical reasons, and to make it easy to find objects.

Removing this special condition on objects would actually simplify quite a few parts of the code. It's technically (relatively) trivial to implement from ID management side of things, but it raises some usability questions:

  • How to make user aware about these 'nowhere to be found' objects? How to make these objects easy to find, edit, delete, re-link, etc.?
  • Is depsgraph able to properly evaluate an object that is not instantiated in the scene at all?

Non-Refcounting Object Usages

Historically, Objects IDs usages were never refcounting (increasing their user count, aka strong reference), besides of course their instantiation in scenes. This was done such that if e.g. a modifier was using an object as parameter, it would not prevent the deletion of that object.

Nowadays, this rule is not followed in most new usages of Objects (when referenced from Nodes, or from an IDProperty e.g.). Further more, our ID deletion code is much more powerful than it used to be, so strong references do not prevent explicit deletion anymore.

In that context, think it's time to move historical Objects usages (like from modifiers or constraints) to also be strong refcounting references. Weak references of IDs should only be used when it really makes sense.

I indeed think that the immediate actionable is to forbid unlinking an object from its last (instantiating) collection (instead of implicitly deleting it when doing so, which is current behavior). On the long run, removing these special handling for objects is a nice goal, but it indeed requires quite some careful UI/UX design: ### All Local Objects Must Be Instantiated Currently, all local objects have to be instantiated in at least one scene, This is done for historical reasons, and to make it easy to find objects. Removing this special condition on objects would actually simplify quite a few parts of the code. It's technically (relatively) trivial to implement from ID management side of things, but it raises some usability questions: * How to make user aware about these 'nowhere to be found' objects? How to make these objects easy to find, edit, delete, re-link, etc.? * Is depsgraph able to properly evaluate an object that is not instantiated in the scene at all? ### Non-Refcounting Object Usages Historically, Objects IDs usages were never refcounting (increasing their user count, aka strong reference), besides of course their instantiation in scenes. This was done such that if e.g. a modifier was using an object as parameter, it would not prevent the deletion of that object. Nowadays, this rule is not followed in most new usages of Objects (when referenced from Nodes, or from an IDProperty e.g.). Further more, our ID deletion code is much more powerful than it used to be, so strong references do not prevent explicit deletion anymore. In that context, think it's time to move historical Objects usages (like from modifiers or constraints) to also be strong refcounting references. Weak references of IDs should only be used when it really makes sense.
Jesse Yurkovich added
Module
Core
and removed
Interest
Core
labels 2023-10-16 19:55:47 +02: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
3 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#113547
No description provided.