no longer use 'check_existing' to see if we need to have a save popup, instead use 'exec' operator on a saved file and
invoke on unsaved files. correct missing memset --> CustomData_reset switch too.
This commit is contained in:
@@ -1290,7 +1290,7 @@ class WM_OT_blenderplayer_start(Operator):
|
||||
return {'CANCELLED'}
|
||||
|
||||
filepath = os.path.join(bpy.app.tempdir, "game.blend")
|
||||
bpy.ops.wm.save_as_mainfile(filepath=filepath, check_existing=False, copy=True)
|
||||
bpy.ops.wm.save_as_mainfile('EXEC_DEFAULT', filepath=filepath, copy=True)
|
||||
subprocess.call([player_path, filepath])
|
||||
return {'FINISHED'}
|
||||
|
||||
|
@@ -112,8 +112,9 @@ class INFO_MT_file(Menu):
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator_context = 'INVOKE_AREA'
|
||||
layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK').check_existing = False
|
||||
layout.operator_context = 'EXEC_AREA' if context.blend_data.is_saved else 'INVOKE_AREA'
|
||||
layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK')
|
||||
|
||||
layout.operator_context = 'INVOKE_AREA'
|
||||
layout.operator("wm.save_as_mainfile", text="Save As...", icon='SAVE_AS')
|
||||
layout.operator_context = 'INVOKE_AREA'
|
||||
|
Reference in New Issue
Block a user