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:
authorDaniel Stokes <kupomail@gmail.com>2013-09-06 03:09:14 +0400
committerDaniel Stokes <kupomail@gmail.com>2013-09-06 03:09:14 +0400
commit8f3b4a77ef6836e6d377479fdf6060d3bab9ab22 (patch)
treead546f0c286a0ce55a9b92dcbb075ec80b0f595e /release
parentac60079ef2234d59a9cdbf5db18e25d03c0d17e3 (diff)
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.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_operators/wm.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index d505aa36d1c..13ee0cc1066 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -1272,6 +1272,8 @@ class WM_OT_blenderplayer_start(Operator):
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 @@ class WM_OT_blenderplayer_start(Operator):
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'}