[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59862] trunk/blender/release/scripts/ startup/bl_operators/wm.py: BGE Fix: [#32360] Standalone Player switches not working

Daniel Stokes kupomail at gmail.com
Fri Sep 6 01:09:14 CEST 2013


Revision: 59862
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59862
Author:   kupoman
Date:     2013-09-05 23:09:14 +0000 (Thu, 05 Sep 2013)
Log Message:
-----------
BGE Fix: [#32360] Standalone Player switches not working

Launching the player from the Blender UI now makes use of the "Debug Properties", "Framerate and Profile", and "Deprecation Warnings" options by setting the appropriate command line flags.

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-09-05 22:59:34 UTC (rev 59861)
+++ trunk/blender/release/scripts/startup/bl_operators/wm.py	2013-09-05 23:09:14 UTC (rev 59862)
@@ -1272,6 +1272,8 @@
         import sys
         import subprocess
 
+        gs = context.scene.game_settings
+
         # these remain the same every execution
         blender_bin_path = bpy.app.binary_path
         blender_bin_dir = os.path.dirname(blender_bin_path)
@@ -1288,7 +1290,26 @@
 
         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])
+
+        # start the command line call with the player path
+        args = []
+        args.append(player_path)
+
+        # handle some UI options as command line arguments
+        value = 1 if gs.show_framerate_profile else 0
+        args.extend(("-g show_framerate = %d"%value).split())
+        args.extend(("-g show_profile = %d"%value).split())
+
+        value = 1 if gs.show_debug_properties else 0
+        args.extend(("-g show_properties = %d"%value).split())
+
+        value = 1 if gs.use_deprecation_warnings else 0
+        args.extend(("-g ignore_deprecation_warnings = %d"%value).split())
+
+        # finish the call with the path to the blend file
+        args.append(filepath)
+
+        subprocess.call(args)
         os.remove(filepath)
         return {'FINISHED'}
 




More information about the Bf-blender-cvs mailing list