[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45671] trunk/blender/release/scripts/ startup/bl_operators/wm.py: rename wm.blenderplayer_start label from 'Start ' to 'Start Game In Player', also made it check if the player is found before running.

Campbell Barton ideasman42 at gmail.com
Mon Apr 16 04:28:22 CEST 2012


Revision: 45671
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45671
Author:   campbellbarton
Date:     2012-04-16 02:28:18 +0000 (Mon, 16 Apr 2012)
Log Message:
-----------
rename wm.blenderplayer_start label from 'Start' to 'Start Game In Player', also made it check if the player is found before running.

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	2012-04-16 01:55:25 UTC (rev 45670)
+++ trunk/blender/release/scripts/startup/bl_operators/wm.py	2012-04-16 02:28:18 UTC (rev 45671)
@@ -1195,7 +1195,7 @@
 class WM_OT_blenderplayer_start(Operator):
     '''Launch the blender-player with the current blend-file'''
     bl_idname = "wm.blenderplayer_start"
-    bl_label = "Start"
+    bl_label = "Start Game In Player"
 
     def execute(self, context):
         import os
@@ -1212,6 +1212,10 @@
         if sys.platform == "darwin":
             player_path = os.path.join(blender_bin_dir, "../../../blenderplayer.app/Contents/MacOS/blenderplayer")
 
+        if not os.path.exists(player_path):
+            self.report({'ERROR'}, "Player path: %r not found" % player_path)
+            return {'CANCELLED'}
+
         filepath = os.path.join(bpy.app.tempdir, "game.blend")
         bpy.ops.wm.save_as_mainfile(filepath=filepath, check_existing=False, copy=True)
         subprocess.call([player_path, filepath])




More information about the Bf-blender-cvs mailing list