Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing shortcut bug #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions SaveIncremental/IncrementalFileSave_v1-7.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand All @@ -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():
Expand Down