Blender 2.8 and damned Garbage Collector

Hello!
I had a bad day because of you.

Faced with the problem.
I created a scene for baking hair, where materials for baking (tangent, normal, AO and others) were assigned to particle hair.

When saving this scene, not all materials were assigned to objects.

As you already understood, I lost unassigned materials while saving.

Please add a warning about garbage collector or a possibility to disable it

3 Likes

Sorry you had a bad day, but this is how Blender has worked since forever. If you want unused data blocks (not just materials) to stay in the .blend, you need to check the Fake User button for that item. Otherwise, they get purged when you save and reload.

Longer explanation:
Blender uses a network model database. Any particular data block can be shared by multiple data blocks. (think linked duplicates) In order to maintain referential integrity when deleting data blocks, it is necessary to walk the entire network. The easiest way to do this is the save/reload process.

2 Likes

You could always add a small Outliner window to your layout in Orphan Data mode that will dynamically show you everything that’s not currently referenced (has no users).

Or just switch your Outliner into that mode before you save after doing a lot of work to double-check that you’re not going to lose anything important.

I know it’s not much help after the fact, and I agree that this is a poor design (to throw everything away rather than risk accumulating unneeded clutter).

1 Like

I think this could use some elaboration since it’s not an intuitive feature. The Fake User button is a little clickable square that has the letter “F” written on it and it’s found to the right of the text-field for both material and texture names. It starts off looking like the default theme color and becomes dark once it’s pressed.

2 Likes

When Materials were simpler things maybe it made sense to throw away all unreferenced ones at Save time, but now that complex nodal Materials can represent as much time investment as an Object Mesh, it seems like a misfeature to just throw them away without warning, and this is a painful lesson that every Blender user seems to have to learn the hard way and which can catch out even the most experienced user.

Objects are always considered worthy of preservation by virtue of always being part of (in 2.8 terminology) a Scene Master Collection, so maybe having a “Master Material Collection” that maintains a link to every Material wouldn’t be such a bad thing. You can still provide some way of identifying Materials without users, but the risk of cluttering up a .blend file with unneeded Materials seems substantially less than the constant risk of a loss of valuable work due to this obsolete behavior.

Not to mention that it would likely match the expected behavior for virtually every new user and the actual behavior of every other 3D application.

The current behavior remains one of the few remaining “sharp edges” that Blender has, and eventually it has to get changed one way or another.

2 Likes

IMO we don’t “need” anymore such thing as automatically removing unused materials (on the user POV at least, maybe it’s needed under the hood).

Most of the time, people don’t expect any data loss when saving a file. They expect a data to be gone only when they deliberately asked for it.

And in the meantime, when we want to delete such data, we can’t do it in a simple & intuitive way.
In other softwares, if you want to delete something, you just select it and press Del or right-click → Delete. If it’s some important data, or if it’s used somewhere, there will be a warning prompt, sometimes even an option to choose a replacement data (like in unreal engine).
But in Blender, this doesn’t exist. You have to find a place where the data has an X cross icon and Shift click that icon (how unintuitive is that ? And you can’t do this for several data at once), or open the outliner, play with the display mode and spend your time on searching your data and managing it the hard way, still dealing with non-standard behaviors and denominations.

I don’t know why Blender works that way. I’m sure there is/was a reason.
If it’s technical, is there a way to get around those issues and obtain a more intuitive and intended behavior?
If it’s a decision of “how blender should work” that have been made before, I think it should be reconsidered with today’s standards: people complain about this, no matter if they are new users or old timers. It’s always a pain.

3 Likes

This fake user workflow really needs to disappear as soon as possible yes…

This is a terribly bad workflow.

Material should even be able to be anywhere in the scene in custom directories without the need to be assigned at all.

Then materials should be externally assignable with rules like : material assignment = ‘/Truck/Cabin/…’

4 Likes

I’m in favor of the way Blender handles this now…
But it seems like an option to enable Fake user by default (on certain types of data blocks) would make several people happy. I expect this shouldn’t be too hard to implement as a add-on.