Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Stokes <mogurijin@gmail.com>2013-08-29 08:31:55 +0400
committerMitchell Stokes <mogurijin@gmail.com>2013-08-29 08:31:55 +0400
commitdea537fd68e0b8c3b3e2fb377a9f4ee0ab897ece (patch)
tree7c61fbbe9084875a889aa71a21b397fa5fd7145e /release
parent567e13b2bb12390fa26f43dc2bd30b7cbf3ed851 (diff)
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.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_operators/wm.py3
1 files changed, 2 insertions, 1 deletions
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'}