New add-on: Incremental Autosave #102

Closed
Demeter Dzadik wants to merge 3 commits from Mets:incremental_autosave into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

image

I wrote this add-on 2 months ago on a Saturday because I got pissed off at Blender's autosave failing because I moved from my Linux PC at work over to my Windows PC at home, along with my user preferences, which contain the autosave filepath, which isn't cross-platform.

I think other guys in the Studio and around the world might also find it useful.

Below is a copy paste of the ReadMe:


This add-on was written to address some shortcomings of Blender's default Autosave functionality.

Blender's Shortcomings:

  • Blender on Linux by default autosaves to /tmp/, which gets nuked on PC restart. So if your PC crashes, your autosaves are gone.
  • This forces you to customize your autosave filepath. But if you do that, and then move your preferences to another OS, the filepath will become invalid and autosaving will cease.
  • One autosave per file. If you take a break for a few minutes, you can't return to the state from before your break.
  • If you just want to go back to a version more than a few minutes old, you simply can't.
  • No autosave for files that weren't saved yet.
  • No autosave when switching files.

This Add-on's Features:

  • Separate filepaths for each OS. Eg., when you're on Linux, you can see and specify a Linux filepath, and when you're on Windows, you can set a separate Windows filepath without overwriting the Linux one.
  • Even if your path is invalid, it will still save in the default OS temp folder.
  • Incremental autosave per file. Eg., if you configure 30 max saves per file at 3 mins/save, you can go back in 3 minute intervals by up to 90 minutes.
  • You can configure it however you want, including infinite saves every minute, if you don't mind a manual cleanup once in a while.
  • Autosaves when opening another file while current one is dirty. (Can be turned off)
  • Autosaves files that were never saved as "Unnamed.blend".

Feedback welcome!

![image](/attachments/d4a690af-763f-4c5e-ab96-11949a51bd56) I wrote this add-on 2 months ago on a Saturday because I got pissed off at Blender's autosave failing because I moved from my Linux PC at work over to my Windows PC at home, along with my user preferences, which contain the autosave filepath, which isn't cross-platform. I think other guys in the Studio and around the world might also find it useful. Below is a copy paste of the ReadMe: ----------------------------------------------------------------------------------------------------------------------------- This add-on was written to address some shortcomings of Blender's default Autosave functionality. ### Blender's Shortcomings: - Blender on Linux by default autosaves to /tmp/, which gets nuked on PC restart. So if your PC crashes, your autosaves are gone. - This forces you to customize your autosave filepath. But if you do that, and then move your preferences to another OS, the filepath will become invalid and autosaving will cease. - One autosave per file. If you take a break for a few minutes, you can't return to the state from before your break. - If you just want to go back to a version more than a few minutes old, you simply can't. - No autosave for files that weren't saved yet. - No autosave when switching files. ### This Add-on's Features: - Separate filepaths for each OS. Eg., when you're on Linux, you can see and specify a Linux filepath, and when you're on Windows, you can set a separate Windows filepath without overwriting the Linux one. - Even if your path is invalid, it will still save in the default OS temp folder. - Incremental autosave per file. Eg., if you configure 30 max saves per file at 3 mins/save, you can go back in 3 minute intervals by up to 90 minutes. - You can configure it however you want, including infinite saves every minute, if you don't mind a manual cleanup once in a while. - Autosaves when opening another file while current one is dirty. (Can be turned off) - Autosaves files that were never saved as "Unnamed.blend". ----------------------------------------------------------------------------------------------------------------------------- Feedback welcome!
Demeter Dzadik added 2 commits 2023-07-06 16:17:38 +02:00
Demeter Dzadik added 1 commit 2023-07-07 11:49:34 +02:00
Francesco Siddi reviewed 2023-07-09 19:18:54 +02:00
Francesco Siddi left a comment
Owner

Just left some overall, quick feedback. I see the issues you are addressing with this add-on, but I am not sure it be included in the Blender Studio add-ons list, as it enables users to alter some critical, core functionality. I would be happy to see a design discussion with core devs to make some of the features part of Blender itself.

Just left some overall, quick feedback. I see the issues you are addressing with this add-on, but I am not sure it be included in the Blender Studio add-ons list, as it enables users to alter some critical, core functionality. I would be happy to see a design discussion with core devs to make some of the features part of Blender itself.
@ -0,0 +2,4 @@
This add-on was written to address some shortcomings of Blender's default Autosave functionality.
### Blender's Shortcomings:

For better communication, consider focusing the text on the features you are adding to Blender's existing functionality. The point about autosaving on tmp is valid, but overall this list is a bit arbitrary.

For better communication, consider focusing the text on the features you are *adding* to Blender's existing functionality. The point about autosaving on tmp is valid, but overall this list is a bit arbitrary.
@ -0,0 +19,4 @@
- Autosaves files that were never saved as "Unnamed.blend".
### Installation
Place the `incremental_autosave` folder into your Blender addons folder. If you need help finding this folder, you can ask ChatGPT for it.

I understand the humour, but please point people to the Blender manual, not a 3rd party service that requires registration.

I understand the humour, but please point people to the Blender manual, not a 3rd party service that requires registration.
@ -0,0 +1,209 @@
bl_info = {

Consider using a code formatter, for example black, to adhere to PEP8.

Consider using a code formatter, for example black, to adhere to PEP8.
@ -0,0 +8,4 @@
"category": "System",
}
import bpy

Look up import sorting (alphabetical, system imports first, one line per import, etc).

Look up import sorting (alphabetical, system imports first, one line per import, etc).
@ -0,0 +47,4 @@
description='Path to auto save files into',
subtype='FILE_PATH',
default='')
autosave_path_mac : StringProperty(name='Autosave Path (Mac)',

macOS

macOS
@ -0,0 +53,4 @@
default='')
@property
def autosave_path_naive(self):

native not naive

native not naive
@ -0,0 +92,4 @@
layout.prop(context.preferences.filepaths, 'use_auto_save_temporary_files', text="Enable Native Autosave")
if not context.preferences.filepaths.use_auto_save_temporary_files:
layout.label(text=" "*40+ "While the built-in autosave is redundant with the add-on, ")

Avoid ASCII art if possible.

Avoid ASCII art if possible.
@ -0,0 +145,4 @@
save_dir = bpy.path.abspath(addon_prefs.autosave_path)
if not os.path.isdir(save_dir):
os.mkdir(save_dir)
except:
Avoid bare exceptions https://www.flake8rules.com/rules/E722.html
Author
Member

Poked Sergey and we agree that the devs have better things to do.
Since the add-on isn't a good fit for this repo, I'll put it in a personal GitLab repo.

I'll implement your suggestions though, thanks for the review!

Poked Sergey and we agree that the devs have better things to do. Since the add-on isn't a good fit for this repo, I'll put it in a personal GitLab repo. I'll implement your suggestions though, thanks for the review!
Demeter Dzadik closed this pull request 2023-07-10 15:05:37 +02:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 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: studio/blender-studio-tools#102
No description provided.