You know you can make a “symbolic link” from your “temp” to your file folder and have all autosaved near your blend in a specific folder if you want.
Utilise simplement un petit programme sur window qui fait des liens symboliques ou sur Mac ou Linux, tu les écrits en fichier text simplement.
Salut.
Spirou4D
This sounds pretty cool. Reminds me a bit of the Versions features some DAWs are now implementing where you can save versions of your project and go back to them when you need to without having to manually create a whole new file using Save As. Pretty slick stuff.
Simple example of an addon that always incremental saves, could be made a menu item too.
Or it could be kept automatic and have some logic added so it ensures files are at least saved with some time between them (addon preference) This way it wouldn’t be annoying to make quick edits and resave a few seconds after the previous save, and the number of files doesn’t explode.
bl_info = {
"name": "Incremental Blend Saves",
"version": (0, 1),
"blender": (2, 74, 0),
"location": "Automatically activated on save",
"description": "Writes versions of the file into 'versionss'",
"category": "System",
}
import bpy
from bpy.app.handlers import persistent
SUBDIR = "blend_versions"
@persistent
def on_save(dummy):
import os
filepath = bpy.data.filepath
if not os.path.exists(filepath):
return
f_dir, f_file = os.path.split(filepath)
f_file_base, f_file_ext = os.path.splitext(f_file)
f_dir_inc = os.path.join(f_dir, SUBDIR)
os.makedirs(f_dir_inc, exist_ok=True)
version = 1
while True:
filepath_version = os.path.join(
f_dir_inc,
"%s_%03d%s" % (f_file_base, version, f_file_ext))
if not os.path.exists(filepath_version):
break
version += 1
import shutil
shutil.copyfile(filepath, filepath_version)
print("Backed up to %r" % filepath_version)
def register():
bpy.app.handlers.save_pre.append(on_save)
def unregister():
bpy.app.handlers.save_pre.remove(on_save)
if __name__ == "__main__":
register()
For example, this week, I have a scene, I save the scene. After, I need to apply some modifiers to send my scene to maya and give the scene to my client.
I don’t want to save this scene on blender with the modifiers applied, but After some time, I forgot and save the document.
I cannot use incremental save because it’s only one scene replaced by the new and the new is the scene with modifiers applied.
So with incremental like I posted yesterday, I could open the good scene.
Just go to User Prefs>file and change save versions to the number you want to keep. It will save and increment the numbers of the saved versions as blend1, blend2, blend3 …
You might think it’s messy but if you had saved a file accidentally causing problems this will get you a working version of the file.
In my case I was testing a daily build with my current project and saved the file. It turns out that the act of saving the file corrupted all the packed png files for my textures so when I opened the file in the 2.74 none of the images were visible. Funny thing is I checked and they still worked in the daily build.
Luckily I had the save versions enabled and I was able to grab the previous version and just save as to get back to a working file.
No save versions does not correct the auto-save issue and I agree the having the auto-save keep a few copies would be helpful.
Mais alors tu peux changer directement l’emplacement du dossier temp dans les préférences utilisateurs si tu veux pour le mettre à coté de ton blend dans un dossier, non?
The problem with using a subdirectory like this is that it can muck up linked data if you’re using relative paths. The .blend1, .blend2, etc. files are already incremental saves; great as rudimentary versioning (and you can increase those values in User Preferences). Autosave in /tmp has been very helpful for recovery purposes. For anything more than that, I use actual version control (Mercurial, in my case).
You are right, blend 1, 2 is usefull too, I use it too but it works when saving and have an auto incremental save in a directory of the project will be great too.
With the current incremental system (blend1, blend2…)
I’m not sure I understand what you’re asking here. Could you restate in another way?
@pitiwazou, there’s still the issue of linked assets. By itself, a .blend file has no self-awareness to know whether it’s the original file or an auto incremental save… so you’d either have to remap relative links when incrementally saving or you’d have to give the .blend this self-awareness (not too difficult) and remap paths when the file is loaded. And which files should the auto incremental save .blend link to? Should it be the original linked file, or should it link to a corresponding incremental save of the linked file? My assumption is that it would be the original file, but it’s a question worth asking.
(this is a WIP, with a lot of bad code stuff, messy code, realy few comments, …)
Also, it is only working on windows for the moment - I do not had time to made it working on linux (and I have no mac to test it).
(Is anyone know a way to convert path automatically… :))
But I’m struggling with the modal doing the timer job:
It do not update on another window than the active one (at script launch) => it can’t be launched from the user prefs.
If the file is saved with another name (for instance: on the image above, when renaming fro Toto_001 to bouba_001), it need to be restarted.
For now, you need to stop it like that (before saving !): http://i.gyazo.com/99ea997fa7169b0081b3c61991e47dde.gif
Then just restart it.
I have an idea about how to fix it with some handlers stuff, I will do that as soon as possible.
The issue is that it is a modal, and I want to block it when running another instance of this modal. So I use a property, but it doesn’t update since the new modal (invoke) code is finished - and it delete this blocking value at the end, to be able to do his job.
As I said, I have a solution, but is there a way to stop a modal operator from outside - with python ?
I wanted to use a handler - a scene update one - to be sure it will always be updated. But it fails, as the handler is lanching the save operator ==> so it update the scene, relaunch itself,…
I wanted to block it thanks t a property, but it is like it do not update it in time / relaunch it so many times, like in a infinite loop.
Any idea ?
That is also an issue with the classical incremental tool (that you can use with the ‘+’ on the save screen), if you use it with other files witch refers to it.
For that, I made an add-on, called Save Incremental (I know, it’s a bit confusing): https://github.com/lapineige/Blender_add-ons/blob/master/SaveIncremental_v1-6.py
It save your file, and save a copy with an incremented number (witch can be customized, it just always increment the last number of the file name).
So the main file as always the same name, and your have your incremental save.
About this topic-related feature, it also allows you to always have this auto save in 1 directory on your PC - not always with you file, witch can be annoying.
Good question… it will continue to work if the original path were absolute. If not, it will fail.
I could answer that is just a temporary backcup in case of crash or if you want to come back to an old version.
But maybe I can change the path to the linked librairies…