patch: confirm on discard unsaved

Something I often hear complained about is the way blender will silently throw away unsaved changes if you do an open, open-recent, or drag-and-drop open while you have unsaved changes.

I’ve made a patch which fixes this. If you care, and want to see this patch included, please speak up here, and or on the task/bug.

This is a nice upgrade. In Linux, blender doesn’t even ask you if you want to save the file when exiting.

Maybe the construction of the notification could be polished. ‘Unsaved changes exist’ doesn’t need a question mark, it is a notification.

If you want a question then perhaps: Unsaved changes exist. Quit Blender?


Step in the right direction. The bigger problem are unsaved images though.

Thanks davesf.

That’s right, it was never implemented on Linux when you close Blender from the close button of your desktop window decorator (the way most people close Blender I think):

@PLyczkowski and anyone else who’s interested:

There’s this patch to fix the unsaved images problem

I have missed something like this, hope it will be included!

Nice work! It’s great to see someone tackle the little annoyances in blender. I can’t wait to see this patch make it to master.

@Aligorith, Thanks to you too.
Regarding that it works only with generated images, why not extend it to any external image that you open to texture paint (not only generated)? Is it a technical impossibility? Or for some reason it would not be advisable to implement?

@davesf, testing your patch and it is working well. The first time that pop up message appeared turned me a little confused about what it was asking me (my bad English), whether to stay in the current project or open the new project. Anyway then you learn how it works.


Seems like the patch only affects images “created in Blender using the “Generated Color” image type as a base”. So good to have it, but it solves the problem only partially.

Even better, why not give the user the option of doing something other than just canceling if they forgot to save?

Although it is good that Blender at least warns users about unsaved data (in certain situations), the warning would be a lot more useful if the dialog gave the user the opportunity to immediately fix the issue. I really miss this simple functionality from other applications that allows you to do a very common two step operation (Save then Exit) in one step, rather than in two steps like you need to do with Blender.