From dea537fd68e0b8c3b3e2fb377a9f4ee0ab897ece Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Thu, 29 Aug 2013 04:31:55 +0000 Subject: BGE: The WM_OT_blenderplayer_start addon now saves a copy of the current blendfile with a trailing '~' to keep paths intact. An unsaved file will still go to the tmp directory. This file is deleted when the blenderplayer process exits. --- release/scripts/startup/bl_operators/wm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'release') diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index c575b6dfdaf..0b379d3852c 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -1286,9 +1286,10 @@ class WM_OT_blenderplayer_start(Operator): self.report({'ERROR'}, "Player path: %r not found" % player_path) return {'CANCELLED'} - filepath = os.path.join(bpy.app.tempdir, "game.blend") + filepath = bpy.data.filepath+'~' if bpy.data.is_saved else os.path.join(bpy.app.tempdir, "game.blend") bpy.ops.wm.save_as_mainfile('EXEC_DEFAULT', filepath=filepath, copy=True) subprocess.call([player_path, filepath]) + os.unlink(filepath) return {'FINISHED'} -- cgit v1.2.3