Dragging Material from Asset Browser (Link mode) to Viewport empty space removes this material from all objects #95636
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
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#95636
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?
System Information
Operating system: Windows-10-10.0.19043-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2080 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 497.29
Blender Version
Broken: version: 3.0.1, branch: master, commit date: 2022-01-25 17:19, hash:
dc2d180181
Also broken in: version: 3.0
Short description of error
Dragging a Material from the Asset browser to empty Space in Viewport removes the Material from all objects in the scene
Exact steps for others to reproduce the error
Added subscriber: @Lumpengnom-3
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Confirmed'
Can confirm (but only in
Link
mode).Also getting this (which might not be related, this seems correct):
Will set this to High prio (even though this is not a regression, seems like it never worked)
Dragging Material from Asset Browser to Viewport removes this material from all objectsto Dragging Material from Asset Browser (Link mode) to Viewport empty space removes this material from all objectsHere it happens in "link mode" and also in "Append (Reuse Data)" Mode. Not in "Append" mode, though.
Added subscriber: @Wovchick
Added subscribers: @mont29, @dr.sybren
This seems to have something to do with the way the material is imported:
This requires some more knowledge than I have of how the "append/link on drag" and "use on drop" collaborate with each other. @mont29 do you know what could be the root cause here? I'm guessing there is an implicit assumption somewhere in the code that a dragged-and-dropped asset is actually going to be linked to something, and if that isn't the case, it'll be deleted. In this case, it means that a pre-existing material is deleted, which is not supposed to happen.
That backtrace is actually not relevant, since that specific deletion is valid (it's deleting the linked version of the material, not the local one, which is expected behavior when re-using an appended ID instead).
Deletion of the local one happens from
WM_drag_free_imported_drag_ID
, which unconditionally deletes the dragged ID when dropped on no valid target. Fixing this is relatively trivial:Unfortunately, while digging a bit more, I found that there are a lot more issues when you start mixing
Link
andAppend
modes from the asset browser, e.g. once a material has been appended, it becomes impossible to get it linked using the drag'n'drop feature... This needs more investigation.Another question raised here is what happens to indirectly linked/appended data (like nodetrees for a material, geometry and materials for an objects, etc.). Afaict currently, those will remain around as orphaned data, which is also a fairly bad behavior.
Added subscriber: @JulianEisel
@JulianEisel if you are fine with proposed fix above, would commit this for 3.1 since this issue is very bad.
And I think we need to create a task to properly handle deletion of 'aborted' dragged data, because right now this is handled in a very poor way.
If you say this fix is what we should do then I'm fine with it of course.
Quite some things changed since this ID freeing for aborting was added, and it wasn't tested a lot since then I think. Now the temporary ID loading code may be a better way to go about it.
This issue was referenced by
66328db703
Changed status from 'Confirmed' to: 'Resolved'