diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-10-28 15:34:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-10-28 15:34:11 +0300 |
commit | bfa24aa945ae10bbe1f954704929fbf05db800ef (patch) | |
tree | 5ab8e01622441d71ba99549d02e6cc5406963d49 | |
parent | 25b7455eea31eca4d72ef96c41414cd96a8f3efd (diff) |
Keymap: PKey only runs BGE when engine is set
-rw-r--r-- | source/blender/editors/object/object_ops.c | 1 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 7cf661de52c..bef64fec8d0 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 858d001a381..9faca757c62 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; } |