Merging r46062 through r46073 from trunk into soc-2011-tomato
[blender.git] / source / blender / editors / space_clip / clip_graph_ops.c
index 7916a96f98c709dfc2dfa47cc00028d94551c965..7ab41078e16d42500bf0d7ea9d41a5e2ab05830f 100644 (file)
 static int ED_space_clip_graph_poll(bContext *C)
 {
        if (ED_space_clip_tracking_poll(C)) {
-               ARegion *ar = CTX_wm_region(C);
+               SpaceClip *sc = CTX_wm_space_clip(C);
 
-               return ar->regiontype == RGN_TYPE_PREVIEW;
+               if (sc->view == SC_VIEW_GRAPH) {
+                       ARegion *ar = CTX_wm_region(C);
+
+                       return ar->regiontype == RGN_TYPE_PREVIEW;
+               }
        }
 
        return FALSE;
@@ -231,8 +235,8 @@ static int mouse_select_curve(bContext *C, float co[2], int extend)
                        tracking->act_track = userdata.track;
 
                        /* make active track be centered to screen */
+                       /* XXX: doesn't work in other opened spaces */
                        marker = BKE_tracking_get_marker(userdata.track, sc->user.framenr);
-
                        clip_view_center_to_point(sc, marker->pos[0], marker->pos[1]);
 
                        /* deselect all knots on newly selected curve */