[Bf-committers] Handling of user data.

Ryan Inch mythologylover75 at gmail.com
Tue May 17 14:26:29 CEST 2022


Hi All,
A lot of really good work on the design has already been done in T61209, 
and there is a very in-depth proposal on this subject with some 
interesting ideas and mockups for data managers, and allowing unlinked 
data to be edited, in this thread by LudvikKoutny on devtalk[1] 
(although there are a number of things in the proposal I don't agree with).

Disclaimer: Most of what I say in this email comes from the discussions 
and mockups by the community and aren't my ideas, I'm just outlining 
them here to facilitate discussion :)

You can see mockups of the "warning on quit" idea here[2][3] and there 
is actually already a precedent for doing this with unsaved images, so 
from what I understand, it would basically be an improvement to that 
system.  The quit dialog would have
1. a warning icon and title that "Unused data will be lost.",
2. a line (or two) that gives a short overview of what would be 
discarded e.g. (13 textures, 17 materials, 12 node groups, 5 unsaved 
renders, etc.),
3. (optional/undecided) a link to more information on why this data is 
unsaved[4],
4. a button to manage data that would either bring up a data management 
window (such as in D14030), the asset browser in data management mode 
(see T61209 and the devtalk thread[1]), or (as Jacob Merrill said) show 
you to the outliner in it's Orphan Data mode, so that you can review and 
save any needed data,
5. a button to cancel quitting, and
6. a button to quit anyway and discard the data.


Harley, you bring up an interesting point about how this would work when 
the file is also unsaved.  I don't think this has been discussed yet, 
but currently I would expect that if the blend file is unsaved that a 
dialog would pop up mentioning this, without mention of the unused data, 
and allow you to cancel, quit anyway, or save the blend file.  If you 
cancel, everything's good; if you quit anyway, everything's good because 
you don't care about unsaved data; if you save, Blender will save the 
file and not quit, then, when you try to quit again, Blender will pop up 
the dialog about unused data.  If Blender changes to a Save & Quit 
operator then I would suggest that it just pop up the second prompt 
about unused data after pressing Save & Quit.

The one potential problem I can see with the above is if you have just 
saved recently, but then altered something temporal, like the selection, 
then in that case the warning wouldn't come up and you could potentially 
lose data.  To account for that case, it might be better to combine the 
dialogs into one with a title like "Warning: Your blend file is unsaved 
and also contains unused data that will be purged on quit", the short 
overview of unsaved data, the Manage Data button (centered), and then on 
the bottom row, the three normal quit dialog buttons (Don't Save (or 
Discard All?), Cancel, and Save).  Or perhaps there would be a good way 
to integrate a checkbox for reviewing data, that if checked would bring 
up the data manager on both save and don't save?  However, as Julien 
Eisel said, this part of the discussion should probably be moved to T61209.


Zack, I'm glad you're getting a better understanding of the issues, and 
I agree it is a fascinating and complex problem.  Your suggestion is 
interesting, however I don't think it's technically possible to display 
orphaned data in a collection.  Maybe instead it would work to add an 
additional outliner to the default layout in Orphan Data mode?  I still 
think warning on quit is the way to go, but more awareness of unused 
data throughout a creative session is potentially a good idea.


Dan, That's an interesting suggestion about warning users ahead of time, 
but it isn't the fake users that will get discarded, it's those that 
aren't marked with fake user (and don't have any real users).  What you 
say would probably work for the first time you unlink a data-block though :)

I too agree that some simple indications would be much better than 
rewriting the garbage collection system and I think that even just 
warning the users and providing a link to documentation would be a huge 
help; I don't think you would even need to include a Manage Data button 
in the first iteration to see a large increase in usability.


Julien, You bring up some good points, and I want to think about them 
more before writing an in-depth reply, but I want to say that I think 
the dialog prompt is more to educate/remind people of the garbage 
collection system, rather than to make it habit-proof. Also, I'm pretty 
sure that Blender's reference counting is an implementation of garbage 
collection[5], although not the most common :)


Ryan Inch (Imaginer)

[1] 
https://devtalk.blender.org/t/proposal-explicit-management-of-data-blocks-and-possible-deprecation-of-fake-user/22852
[2] https://developer.blender.org/T61209#1303789
[3] https://developer.blender.org/T61209#1303846
[4] 
https://docs.blender.org/manual/en/latest/files/data_blocks.html#life-time
[5] 
https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)#Reference_counting

Again, no quotes because of gmail :(



More information about the Bf-committers mailing list