Make saving of quit.blend on exit optional #91452

Open
opened 2021-09-16 12:52:20 +02:00 by Sybren A. Stüvel · 8 comments

Description & Scope of Problem

Every time Blender quits, when it has something on the undo stack, it will write the current "undo file" to ${TEMPDIR}/quit.blend (manual).

Saving quit.blend can take a while when the file is large. While the file is being written, Blender's UI is gray and unresponsive.

The problem is not pressing, as usually it takes considerably longer to load the files in the first place. I've asked some artists at the Blender Studio and they didn't really consider the delay when quitting Blender a practical issue. Still, it gets somewhat in the way of quickly testing things with various production blend files, so it could be seen as an issue for developers more than for artists.

Possible Solutions & Impact

Simplest solution:

As a solution we could introduce a user preference "Save Recovery File" that is enabled by default. Disabling this option would:

  • Avoid writing quit.blend.
  • Remove the "File ‣ Recover ‣ Last Session" menu item.
  • Remove the "Recover Last Session" button from the splash screen.

Alternative solution:

The "Recover Last Session" operator does not poll the filesystem from its poll function. This means that the operator is available even when the file ${TEMPDIR}/quit.blend does not exist. Changing this, such that the operator is disabled when quit.blend does not exists, means that the above solution would not have to remove the recovery operators when "Save Recovery File" is disabled. The operators would auto-detect whether a recovery file is available at all.

The upside of this solution is that it makes the "Recover Last Session" operator appear more reliable, as it refuses to work when it knows it cannot do its job. This would be an improvement regardless of the "Save Recovery File" status.

The downside is that an old quit.blend might be lingering around after "Save Recovery File" has been disabled. This means that it could appear as if you could still recover, but it would load an older file. This could be avoided by removing quit.blend when disabling "Save Recovery File", but I'm not a big fan of Blender explicitly removing files that are meant to recover from human error.

Discussion Topics

This task is meant to discuss the following:

  • Do we want to make it possible to quit without writing quit.blend at all?
  • If so, which of the solutions is preferred? Or is there another way to deal with this that's even better?
  • Do we want this as a general option, or something that's enabled only when "Developer Extras" are enabled?
### Description & Scope of Problem Every time Blender quits, when it has something on the undo stack, it will write the current "undo file" to `${TEMPDIR}/quit.blend` ([manual](https://docs.blender.org/manual/en/dev/files/blend/open_save.html#last-session)). Saving `quit.blend` can take a while when the file is large. While the file is being written, Blender's UI is gray and unresponsive. The problem is not pressing, as usually it takes considerably longer to load the files in the first place. I've asked some artists at the Blender Studio and they didn't really consider the delay when quitting Blender a practical issue. Still, it gets somewhat in the way of quickly testing things with various production blend files, so it could be seen as an issue for developers more than for artists. ### Possible Solutions & Impact **Simplest solution:** As a solution we could introduce a user preference "Save Recovery File" that is enabled by default. Disabling this option would: - Avoid writing `quit.blend`. - Remove the "File ‣ Recover ‣ Last Session" menu item. - Remove the "Recover Last Session" button from the splash screen. **Alternative solution:** The "Recover Last Session" operator does not poll the filesystem from its poll function. This means that the operator is available even when the file `${TEMPDIR}/quit.blend` does not exist. Changing this, such that the operator is disabled when `quit.blend` does not exists, means that the above solution would not have to remove the recovery operators when "Save Recovery File" is disabled. The operators would auto-detect whether a recovery file is available at all. The upside of this solution is that it makes the "Recover Last Session" operator appear more reliable, as it refuses to work when it knows it cannot do its job. This would be an improvement regardless of the "Save Recovery File" status. The downside is that an old `quit.blend` might be lingering around after "Save Recovery File" has been disabled. This means that it could appear as if you could still recover, but it would load an older file. This could be avoided by removing `quit.blend` when disabling "Save Recovery File", but I'm not a big fan of Blender explicitly removing files that are meant to recover from human error. ### Discussion Topics This task is meant to discuss the following: - Do we want to make it possible to quit without writing `quit.blend` at all? - If so, which of the solutions is preferred? Or is there another way to deal with this that's even better? - Do we want this as a general option, or something that's enabled only when "Developer Extras" are enabled?
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

Added subscriber: @Memento

Added subscriber: @Memento

Hello Sybren,

For Linux having such a file in /tmp can be very appreciated! Has saved my bacon a few times in the past. Make it an option in the Preferences, so users can decide for themselves if they want it written to disk, yes or no...

But for macOS, why it has to go to /var/folders/yw/0b8fs_892hddm2xsptytmx8r0000gn/T (with the hash-like bit alternating / changing?) is a little beyond me, this while macOS has a perfectly fine and official /tmp directory, even though it points to /private/tmp

Greetz,

Anton
Hello Sybren, For Linux having such a file in /tmp can be very appreciated! Has saved my bacon a few times in the past. Make it an option in the Preferences, so users can decide for themselves if they want it written to disk, yes or no... But for macOS, why it has to go to /var/folders/yw/0b8fs_892hddm2xsptytmx8r0000gn/T (with the hash-like bit alternating / changing?) is a little beyond me, this while macOS has a perfectly fine and official /tmp directory, even though it points to /private/tmp Greetz, ``` Anton
Member

Added subscriber: @Harley

Added subscriber: @Harley
Member

Separate from all these great solutions, it might also make sense to hide the app/main window before saving the "quit blend" during the quit process. I have used many apps that, when closing, seem to close immediately but really continue doing some operations for a while before completely exiting. Here is a patch that does that: https://developer.blender.org/D12558

Separate from all these great solutions, it might also make sense to hide the app/main window before saving the "quit blend" during the quit process. I have used many apps that, when closing, seem to close immediately but really continue doing some operations for a while before completely exiting. Here is a patch that does that: https://developer.blender.org/D12558
Author
Member

@Harley personally I'm not a big fan of such behaviour. When Blender has quit, I want to be sure it's safe to reboot/shut down my computer, and not wait a few seconds more for some invisible thing to end.

@Harley personally I'm not a big fan of such behaviour. When Blender has quit, I want to be sure it's safe to reboot/shut down my computer, and not wait a few seconds more for some invisible thing to end.
Member

@dr.sybren - Yes, no worries. It was just a thought. We’d probably bloat out that “hidden time” too after a while. I’ve abandoned that experiment.

@dr.sybren - Yes, no worries. It was just a thought. We’d probably bloat out that “hidden time” too after a while. I’ve abandoned that experiment.
Philipp Oeser removed the
Interest
Core
label 2023-02-09 14:43:09 +01:00
Sign in to join this conversation.
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
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#91452
No description provided.