Commit: bfa24aa945ae10bbe1f954704929fbf05db800ef
Author: Campbell Barton
Date:   Tue Oct 28 13:34:11 2014 +0100
Branches: master
https://developer.blender.org/rBbfa24aa945ae10bbe1f954704929fbf05db800ef

Keymap: PKey only runs BGE when engine is set

===================================================================

M       source/blender/editors/object/object_ops.c
M       source/blender/editors/space_view3d/view3d_view.c

===================================================================

diff --git a/source/blender/editors/object/object_ops.c 
b/source/blender/editors/object/object_ops.c
index 7cf661d..bef64fe 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -320,6 +320,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
        ED_keymap_proportional_cycle(keyconf, keymap);
        ED_keymap_proportional_obmode(keyconf, keymap);
 
+       /* game-engine only, leave free for users to define */
        WM_keymap_add_item(keymap, "VIEW3D_OT_game_start", PKEY, KM_PRESS, 0, 
0);
 
        kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_all", AKEY, 
KM_PRESS, 0, 0);
diff --git a/source/blender/editors/space_view3d/view3d_view.c 
b/source/blender/editors/space_view3d/view3d_view.c
index 858d001..9faca75 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -1543,18 +1543,22 @@ static void game_set_commmandline_options(GameData *gm)
 
 static int game_engine_poll(bContext *C)
 {
+       bScreen *screen;
        /* we need a context and area to launch BGE
         * it's a temporary solution to avoid crash at load time
         * if we try to auto run the BGE. Ideally we want the
         * context to be set as soon as we load the file. */
 
        if (CTX_wm_window(C) == NULL) return 0;
-       if (CTX_wm_screen(C) == NULL) return 0;
+       if ((screen = CTX_wm_screen(C)) == NULL) return 0;
        if (CTX_wm_area(C) == NULL) return 0;
 
        if (CTX_data_mode_enum(C) != CTX_MODE_OBJECT)
                return 0;
 
+       if (!BKE_scene_uses_blender_game(screen->scene))
+               return 0;
+
        return 1;
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to