ID Deduplication on Append - UX #90546

Open
opened 2021-08-09 15:25:24 +02:00 by Bastien Montagne · 4 comments

This task is about which behavior should be default when linking/appending IDs, and assets, and how much/how users should be able to customize those behaviors.

NOTE: Currently this is mostly listing topics to be discussed. This is also a first pass, there are likely many more use cases/topics to be discussed.

Problem

Currently, when appending a data-block, Blender appends (i.e. link and make local) the ID and all of its dependencies.

This means that if a single object in appended ten times, you will get ten copies of the object, but also of its meshes, materials, animations, etc.

This behavior may be fine in some cases, but not in others.

Default Behaviors

Generic Considerations

To avoid having many copies of the same ID, the first appended copy needs to be re-used for the subsequent appends.

Do we always re-use that ID, even if it has already been modified by the user locally?

Think first appended ID should always be re-used, reliably detecting modified IDs compared to linked one is possible, but tricky and not very efficient (RNA diffing)... There could be a mechanism though to break that reference such that next append creates a new copy of it. No diffing. User has ways to make an existing local ID not re-usable anymore, and to force not re-using an ID when appending again.

Could we use the UserPreferences settings for data copying, to decide which ID types we systematically create new copies for, and which ID types we try to re-use previously appended ID?

Specific Cases

Here is a list of different use cases, possible behaviors being:

  • Link.
  • Append (Link + Make Local, aka new copy).
  • Re-use of previously appended local ID.

Append Material

Data type DEFAULT Alternative Behavior 1
Material itself: re-use duplicate
Image: NA re-use
Node groups: NA duplicate
Actions: NA duplicate

Append Object

Data type DEFAULT Alternative Behavior 1
Object itself: duplicate duplicate
Obdata: re-use duplicate
Actions: re-use duplicate
Materials: re-use Apply Materials Rules ?

Append Collection

Collection itself:* In case of Empty-based instantiation:
*In case of ViewLayer-based instantiation: Object: same as above for Object case?

User Customization

Change behavior in UserSettings

Should user be able to change default behavior in user settings, or only on a case-by-case basis when actually linking/appending IDs or assets?

Change Behavior in Asset/File browsers

Should user be able to toggle options like "Link everything", or "Never deduplicate" ? etc.

This task is about which behavior should be default when linking/appending IDs, and assets, and how much/how users should be able to customize those behaviors. NOTE: Currently this is mostly listing topics to be discussed. This is also a first pass, there are likely many more use cases/topics to be discussed. # Problem Currently, when appending a data-block, Blender appends (i.e. link and make local) the ID and all of its dependencies. This means that if a single object in appended ten times, you will get ten copies of the object, but also of its meshes, materials, animations, etc. This behavior may be fine in some cases, but not in others. # Default Behaviors ## Generic Considerations To avoid having many copies of the same ID, the first appended copy needs to be re-used for the subsequent appends. # Do we always re-use that ID, even if it has already been modified by the user locally? *Think first appended ID should always be re-used, reliably detecting modified IDs compared to linked one is possible, but tricky and not very efficient (RNA diffing)... There could be a mechanism though to break that reference such that next append creates a new copy of it.* **No diffing.** User has ways to make an existing local ID not re-usable anymore, and to force not re-using an ID when appending again. # ~~Could we use the UserPreferences settings for data copying, to decide which ID types we systematically create new copies for, and which ID types we try to re-use previously appended ID?~~ ## Specific Cases Here is a list of different use cases, possible behaviors being: * Link. * Append (Link + Make Local, aka new copy). * Re-use of previously appended local ID. ### Append Material | Data type | DEFAULT | Alternative Behavior 1 | | --- | --- | --- | | Material itself: | re-use | *duplicate* | | Image: | NA | re-use | | Node groups: | NA | *duplicate* | | Actions: | NA | *duplicate* | ### Append Object | Data type | DEFAULT | Alternative Behavior 1 | | --- | --- | --- | | Object itself: | *duplicate* | *duplicate* | | Obdata: | re-use | *duplicate* | | Actions: | re-use | *duplicate* | | Materials: | re-use | Apply Materials Rules ? | ### Append Collection **Collection itself:*** In case of Empty-based instantiation: ***In case of ViewLayer-based instantiation:** Object: *same as above for Object case?* # User Customization ## Change behavior in UserSettings Should user be able to change default behavior in user settings, or only on a case-by-case basis when actually linking/appending IDs or assets? ## Change Behavior in Asset/File browsers Should user be able to toggle options like "Link everything", or "Never deduplicate" ? etc.
Author
Owner

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

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

Added subscriber: @mont29

Added subscriber: @mont29
Member

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker
Member

Efficiency depends also on how many times the code will be run. If the diffing process only runs once is a different store than running it multiple times. Updating caches also takes time and should be added into the consideration.

The mechanism could also be configured per operator. In D12116 I added a mechanism that could do this per operator in a generic way (not pushing this patch, just mentioning this for consideration).

Efficiency depends also on how many times the code will be run. If the diffing process only runs once is a different store than running it multiple times. Updating caches also takes time and should be added into the consideration. The mechanism could also be configured per operator. In [D12116](https://archive.blender.org/developer/D12116) I added a mechanism that could do this per operator in a generic way (not pushing this patch, just mentioning this for consideration).
Bastien Montagne added this to the Core project 2023-02-09 15:42:54 +01:00
Bastien Montagne removed this from the Core project 2023-02-09 18:20:37 +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#90546
No description provided.