diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-12 16:06:40 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-12 16:06:40 +0400 |
commit | 8ef23c6743ce00176754597f60ae549093ab6339 (patch) | |
tree | 726acad3e54968c6f1ed6769b3a2c76325d016b1 /source/blender/editors/space_clip | |
parent | 5a878c50ebe88eb6d41977a6f8c9201ec527b061 (diff) |
Clip editor mode selection: show menu with modes on TAB
This seems to be the only straightforward way to switch fast between
modes without keeping bunch of shortcuts and current mode in head.
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r-- | source/blender/editors/space_clip/clip_ops.c | 20 | ||||
-rw-r--r-- | source/blender/editors/space_clip/space_clip.c | 8 |
2 files changed, 4 insertions, 24 deletions
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 948b6490331..86d74ef4c78 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -62,6 +62,7 @@ #include "RNA_access.h" #include "RNA_define.h" +#include "RNA_enum_types.h" #include "UI_view2d.h" @@ -1074,15 +1075,8 @@ static int mode_set_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); int mode = RNA_enum_get(op->ptr, "mode"); - int toggle = RNA_boolean_get(op->ptr, "toggle"); - if (sc->mode == mode) { - if (toggle) - sc->mode = SC_MODE_TRACKING; - } - else { - sc->mode = mode; - } + sc->mode = mode; WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CLIP, NULL); @@ -1091,13 +1085,6 @@ static int mode_set_exec(bContext *C, wmOperator *op) void CLIP_OT_mode_set(wmOperatorType *ot) { - static EnumPropertyItem mode_items[] = { - {SC_MODE_TRACKING, "TRACKING", 0, "Tracking", "Show tracking and solving tools"}, - {SC_MODE_RECONSTRUCTION, "RECONSTRUCTION", 0, "Reconstruction", "Show tracking/reconstruction tools"}, - {SC_MODE_DISTORTION, "DISTORTION", 0, "Distortion", "Show distortion tools"}, - {0, NULL, 0, NULL, NULL}}; - - /* identifiers */ ot->name = "Set Clip Mode"; ot->description = "Set the clip interaction mode"; @@ -1109,8 +1096,7 @@ void CLIP_OT_mode_set(wmOperatorType *ot) ot->poll = ED_space_clip_poll; /* properties */ - RNA_def_enum(ot->srna, "mode", mode_items, SC_MODE_TRACKING, "Mode", ""); - RNA_def_boolean(ot->srna, "toggle", 0, "Toggle", ""); + RNA_def_enum(ot->srna, "mode", clip_editor_mode_items, SC_MODE_TRACKING, "Mode", ""); } /********************** macroses *********************/ diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index 13caf0b51fe..3623cd1d58b 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -559,13 +559,7 @@ static void clip_keymap(struct wmKeyConfig *keyconf) RNA_boolean_set(kmi->ptr, "sequence", TRUE); /* mode */ - kmi = WM_keymap_add_item(keymap, "CLIP_OT_mode_set", TABKEY, KM_PRESS, 0, 0); - RNA_enum_set(kmi->ptr, "mode", SC_MODE_RECONSTRUCTION); - RNA_boolean_set(kmi->ptr, "toggle", TRUE); - - kmi = WM_keymap_add_item(keymap, "CLIP_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0); - RNA_enum_set(kmi->ptr, "mode", SC_MODE_DISTORTION); - RNA_boolean_set(kmi->ptr, "toggle", TRUE); + WM_keymap_add_menu(keymap, "CLIP_MT_select_mode", TABKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "CLIP_OT_solve_camera", SKEY, KM_PRESS, KM_SHIFT, 0); |