[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59624] trunk/blender/release/scripts/ startup/bl_operators/wm.py: BGE: The WM_OT_blenderplayer_start addon now saves a copy of the current blendfile with a trailing '~' to keep paths intact.

Mitchell Stokes mogurijin at gmail.com
Thu Aug 29 06:31:55 CEST 2013


Revision: 59624
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59624
Author:   moguri
Date:     2013-08-29 04:31:55 +0000 (Thu, 29 Aug 2013)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_operators/wm.py

Modified: trunk/blender/release/scripts/startup/bl_operators/wm.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/wm.py	2013-08-29 04:26:40 UTC (rev 59623)
+++ trunk/blender/release/scripts/startup/bl_operators/wm.py	2013-08-29 04:31:55 UTC (rev 59624)
@@ -1286,9 +1286,10 @@
             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'}
 
 




More information about the Bf-blender-cvs mailing list