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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-05-02 21:33:48 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-05-02 21:33:48 +0400
commit6f3400ca521e84b1b627f2b5a53835d73e3ed2ea (patch)
treede3f9d78f38aa26b4c46098653d090352d8fb644 /source/blender/editors/space_clip
parentd64661b5078cd4781bd58fce6fadedac511c4132 (diff)
Clip editor: cleanup of View menu - do not show operators which doesn't make sense in dopesheet/curve view
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r--source/blender/editors/space_clip/clip_editor.c11
-rw-r--r--source/blender/editors/space_clip/clip_graph_ops.c6
-rw-r--r--source/blender/editors/space_clip/clip_ops.c14
3 files changed, 19 insertions, 12 deletions
diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c
index 443cb8f7ef4..c5c5628abb9 100644
--- a/source/blender/editors/space_clip/clip_editor.c
+++ b/source/blender/editors/space_clip/clip_editor.c
@@ -73,6 +73,17 @@ int ED_space_clip_poll(bContext *C)
return FALSE;
}
+int ED_space_clip_view_clip_poll(bContext *C)
+{
+ SpaceClip *sc = CTX_wm_space_clip(C);
+
+ if (sc && sc->clip) {
+ return sc->view == SC_VIEW_CLIP;
+ }
+
+ return FALSE;
+}
+
int ED_space_clip_tracking_poll(bContext *C)
{
SpaceClip *sc= CTX_wm_space_clip(C);
diff --git a/source/blender/editors/space_clip/clip_graph_ops.c b/source/blender/editors/space_clip/clip_graph_ops.c
index 03557a0b264..905aa2d11d4 100644
--- a/source/blender/editors/space_clip/clip_graph_ops.c
+++ b/source/blender/editors/space_clip/clip_graph_ops.c
@@ -66,11 +66,7 @@ static int ED_space_clip_graph_poll(bContext *C)
if (ED_space_clip_tracking_poll(C)) {
SpaceClip *sc = CTX_wm_space_clip(C);
- if (sc->view == SC_VIEW_GRAPH) {
- ARegion *ar = CTX_wm_region(C);
-
- return ar->regiontype == RGN_TYPE_PREVIEW;
- }
+ return sc->view == SC_VIEW_GRAPH;
}
return FALSE;
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index 2bfc7a1dec8..133c807a7ff 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -408,7 +408,7 @@ void CLIP_OT_view_pan(wmOperatorType *ot)
ot->invoke = view_pan_invoke;
ot->modal = view_pan_modal;
ot->cancel = view_pan_cancel;
- ot->poll = ED_space_clip_poll;
+ ot->poll = ED_space_clip_view_clip_poll;
/* flags */
ot->flag = OPTYPE_BLOCKING;
@@ -534,7 +534,7 @@ void CLIP_OT_view_zoom(wmOperatorType *ot)
ot->invoke = view_zoom_invoke;
ot->modal = view_zoom_modal;
ot->cancel = view_zoom_cancel;
- ot->poll = ED_space_clip_poll;
+ ot->poll = ED_space_clip_view_clip_poll;
/* flags */
ot->flag = OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
@@ -580,7 +580,7 @@ void CLIP_OT_view_zoom_in(wmOperatorType *ot)
/* api callbacks */
ot->exec = view_zoom_in_exec;
ot->invoke = view_zoom_in_invoke;
- ot->poll = ED_space_clip_poll;
+ ot->poll = ED_space_clip_view_clip_poll;
/* properties */
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in screen coordinates", -10.0f, 10.0f);
@@ -620,7 +620,7 @@ void CLIP_OT_view_zoom_out(wmOperatorType *ot)
/* api callbacks */
ot->exec = view_zoom_out_exec;
ot->invoke = view_zoom_out_invoke;
- ot->poll = ED_space_clip_poll;
+ ot->poll = ED_space_clip_view_clip_poll;
/* properties */
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in normalised (0.0-1.0) coordinates", -10.0f, 10.0f);
@@ -652,7 +652,7 @@ void CLIP_OT_view_zoom_ratio(wmOperatorType *ot)
/* api callbacks */
ot->exec = view_zoom_ratio_exec;
- ot->poll = ED_space_clip_poll;
+ ot->poll = ED_space_clip_view_clip_poll;
/* properties */
RNA_def_float(ot->srna, "ratio", 0.0f, 0.0f, FLT_MAX,
@@ -719,7 +719,7 @@ void CLIP_OT_view_all(wmOperatorType *ot)
/* api callbacks */
ot->exec = view_all_exec;
- ot->poll = ED_space_clip_poll;
+ ot->poll = ED_space_clip_view_clip_poll;
/* properties */
RNA_def_boolean(ot->srna, "fit_view", 0, "Fit View", "Fit frame to the viewport");
@@ -749,7 +749,7 @@ void CLIP_OT_view_selected(wmOperatorType *ot)
/* api callbacks */
ot->exec = view_selected_exec;
- ot->poll = ED_space_clip_poll;
+ ot->poll = ED_space_clip_view_clip_poll;
}
/********************** change frame operator *********************/