Fix #34574: Empty Movie Clip Editor crash on select
authorSergey Sharybin <sergey.vfx@gmail.com>
Sat, 9 Mar 2013 10:52:43 +0000 (10:52 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sat, 9 Mar 2013 10:52:43 +0000 (10:52 +0000)
source/blender/editors/space_clip/tracking_select.c

index bec5013..d320d41 100644 (file)
@@ -268,6 +268,17 @@ static int mouse_select(bContext *C, float co[2], int extend)
        return OPERATOR_FINISHED;
 }
 
+static int select_poll(bContext *C)
+{
+       SpaceClip *sc = CTX_wm_space_clip(C);
+
+       if (sc) {
+               return sc->clip && sc->view == SC_VIEW_CLIP;
+       }
+
+       return FALSE;
+}
+
 static int select_exec(bContext *C, wmOperator *op)
 {
        float co[2];
@@ -317,8 +328,7 @@ void CLIP_OT_select(wmOperatorType *ot)
        /* api callbacks */
        ot->exec = select_exec;
        ot->invoke = select_invoke;
-       //ot->poll = ED_space_clip_tracking_poll; // so mask view can Ctrl+RMB markers
-       ot->poll = ED_space_clip_view_clip_poll;
+       ot->poll = select_poll;
 
        /* flags */
        ot->flag = OPTYPE_UNDO;