Recursive Purge Orphans datablocks on file save #87490
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#87490
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?
Fully deleting datablocks from a blend file doesn't happen as easily as most users might expect, since "delete" is often used in the UI when "un-link" is what is actually meant. This can cause a lot of confusion and uncertainty during production. Proper deletion of datablocks requires that they are first un-linked, then they can be purged via File->Clean Up->Recursive Unused Datablocks. This works beautifully, and I would like to propose adding an option to have this operation executed after existing deletion operators. For example, after deleting a collection of objects, it would then also delete everything that was used only by those objects, such as their mesh and shape key datablocks, materials, actions, textures, etc.
My previous proposal was to have an option to execute Recursive Purge only on file save, which seemed to make sense to everyone I talked to at the time. (@dr.sybren @mont29 @JulianEisel @SimonThommes )
I still think that solution would be a step forward, but the new proposal above would achieve the same goals in an even more foolproof way.
Use case
Currently, this can very easily happen:
As they continue working and duplicating characters, the old, unused objects slowly get deleted, and the name suffixes really get all over the place. It's not nice to get your objects names all mixed up like this, as things get really confusing when trying to troubleshoot problems in a production file, since everywhere where one object references another, the mismatching suffixes give the troubleshooter anxiety and uncertainty. The only way to avoid this currently is to tell the entire production team to always run a recursive Purge after deleting anything, which is very error-prone.
Potential issues
Added subscribers: @SimonThommes, @JulianEisel, @mont29, @dr.sybren, @Mets
Marking as "Good first issue" on Julian's suggestion, if any contributors would like to pick this up, it's probably(hopefully) simple on the implementation side.
Also related to #61209 (Always write unused IDs on save)
Whoops, so much for "Good first issue"! I forgot about that task, thanks for the reminder. Maybe this task is sort of redundant then, since the design proposed in #61209 solves the same issues, and perhaps more elegantly. It's just a shame since that seems like a pretty daunting task that probably won't be tackled for some time, so until then I am left with shoving a "Purge All" button in the animation team's face and hope that they press it often. :/
With that design in mind, I think what I'm asking for here could manifest as a "Purge on Save" user preference, that would bring back the old(current) behaviour except with a recursive purge. (Performance be damned.) Alternatively, it would be interesting to explore more ways to allow datablocks to not have to share a name space. Right now, linked and local datablocks are in separate name spaces, which I think is great. If we could have a similar thing for deleted databloks, I think that could be interesting, and also make sense from user PoV.
@mont29 Do you think it's better to close this task and add my thoughts to the discussion in the other thread, or is it worthwhile to keep this separate?
@Mets would keep both for now, while related they are not entirely the same. We can re-iterate on designs and such once we actually start working on those.
Added subscriber: @ckohl_art
Added subscriber: @RedMser
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Confirmed'
Would assume this can be confirmed as a status then (to get it out of the triaging queue).