From 348fef1a01864e49391255e5e3cc076c3480f274 Mon Sep 17 00:00:00 2001 From: Spiraloid <36362743+spiraloid@users.noreply.github.com> Date: Thu, 20 Sep 2018 21:35:24 -0700 Subject: [PATCH] fixing shortcut bug -switched from file. to wm. so that shortcuts would work. -added reopen after save to make save overwrite correct file. -added double save to add new file to recents list. --- SaveIncremental/IncrementalFileSave_v1-7.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SaveIncremental/IncrementalFileSave_v1-7.py b/SaveIncremental/IncrementalFileSave_v1-7.py index 4679802..9c908ef 100644 --- a/SaveIncremental/IncrementalFileSave_v1-7.py +++ b/SaveIncremental/IncrementalFileSave_v1-7.py @@ -36,7 +36,7 @@ def detect_number(name): return False class FileIncrementalSave(bpy.types.Operator): - bl_idname = "file.save_incremental" + bl_idname = "wm.save_incremental" bl_label = "Save Incremental" def execute(self, context): @@ -87,6 +87,8 @@ def execute(self, context): return {'CANCELLED'} bpy.ops.wm.save_mainfile() bpy.ops.wm.save_as_mainfile(filepath=output, copy=True) + bpy.ops.wm.open_mainfile( filepath = output ) # to make save overwrite the correct file. + bpy.ops.wm.save_mainfile() # to add to recents. self.report({'INFO'}, "File: {0} - Created at: {1}".format(output[len(bpy.path.abspath(d_sep)):], output[:len(bpy.path.abspath(d_sep))])) else: @@ -95,7 +97,7 @@ def execute(self, context): ###### PENSER A TESTER AUTRES FICHIERS DU DOSSIER, VOIR SI TROU DANS NUMEROTATION==> WARNING def draw_into_file_menu(self,context): - self.layout.operator('file.save_incremental', icon='SAVE_COPY') + self.layout.operator('wm.save_incremental', icon='SAVE_COPY') def register():