Is it possible to create an add-on that alerts the user when he didn’t save for some time? For example, after 10 minutes from the last save, an alert appears in the info bar and suggests the user to save. Possible?
Just in case you don’t know:
By default, Blender auto-saves every 5 minutes to a temp-file, which can be recovered with File->Recover Auto Save. There are settings for this under User Preferences->File.
I already know that, thankyou!
What encn is saying is that an alert is unnecessary if the program makes a backup every 5 mins. Why remind you to save when the program does it for you?
well you could, but i don’t recommend this:
import bpy import time bpy.types.Scene.last_time = bpy.props.FloatProperty() bpy.context.scene.last_time = time.clock() def remind_to_save(scene): if time.clock() - scene.last_time > 600: # 10 min print("you need to save work!") scene.last_time = time.clock() bpy.app.handlers.scene_update_post.append(remind_to_save)
scene_update_* event occurs a lot, thus it should remind you even if you are afk (no input), but might get called very often, causing a little slowdown in entire blender…