10

I'm accustomed to saving frequently using Ctrl+S in Blender. Each time I do this, Blender pops up the "Save Over?" button, which I have to click (or press Enter).

This gets in the flow of things. Is there a reasonably simple method to disable this behavior and just Save Over without prompting. (Reasonably simple meaning without modifying Blender's source code.)

gandalf3
  • 157,169
  • 58
  • 601
  • 1,133
ApoorvaJ
  • 619
  • 2
  • 6
  • 19

2 Answers2

7

To the best of my knowledge, this cannot be changed. Here are a few workarounds that might be helpful however.

Use a script

If you use the command bpy.ops.wm.save_mainfile() and register a shortcut, you would just need to do a normal save once (for Blender to get the path) and after that, use CtrlShift + Y as I have done in the script below to save without any popups. (You can also change this if you want, see the commented line).

import bpy

class SaveWithoutPrompt(bpy.types.Operator): bl_idname = "object.save_without_prompt" bl_label = "Save without prompt"

def execute(self, context):
    bpy.ops.wm.save_mainfile()
    return {'FINISHED'}

def menu_func(self, context): self.layout.operator(SaveWithoutPrompt.bl_idname)

addon_kmaps = []

def register(): bpy.utils.register_class(SaveWithoutPrompt)

wm = bpy.context.window_manager
km = wm.keyconfigs.addon.keymaps.new(name='Object Mode', space_type='EMPTY')
# change the shortcut here..
kmi = km.keymap_items.new(SaveWithoutPrompt.bl_idname, 'Y', 'PRESS', ctrl=True, shift=True)
addon_kmaps.append(km)

def unregister(): bpy.utils.unregister_class(SaveWithoutPrompt) bpy.types.VIEW3D_MT_object.remove(menu_func)

wm = bpy.context.window_manager
for km in addon_kmaps:
    wm.keyconfigs.addon.kmaps.remove(km)
del addon_kmaps[:]

if name == "main": register()


Set the autosave feature to save more often

enter image description here

You could have Blender save a copy of the file you are working on every minute. This runs in the background so no popups. You can find this feature under the File tab in your User Preferences.

Related, Blender saves a new file every time

iKlsR
  • 43,379
  • 12
  • 156
  • 189
  • Wouldn't it be possible to overwrite the Ctrl+S shortcut with the script? (so Ctrl+S executes the script instead of the popup) you could probably also make the script call the file browser if the file has not yet been saved. – gandalf3 Sep 20 '13 at 01:23
  • @gandalf3 It is possible to overwrite Ctrl + S and yes, a first call to save could be done, I omitted that bit since I was in class at the time. Really trivial tho. – iKlsR Sep 20 '13 at 01:51
3

No, The way the save operator (bpy.ops.wm.save_mainfile) works is when its activated with the filepath property set (as with File -> Save), it will execute immediately, but when its activated from a key-binding where the filepath is not set. it will activate a popup menu.

The only way around this is to create your own operator which calls bpy.ops.wm.save_mainfile with the filepath set. Then bind the key to this new operator.

ideasman42
  • 47,387
  • 10
  • 141
  • 223