Fix T67062: Movie Clip Editor does not update Editor Type when changing Editing Context
authorSebastian Parborg <darkdefende@gmail.com>
Thu, 18 Jul 2019 13:25:37 +0000 (15:25 +0200)
committerSebastian Parborg <darkdefende@gmail.com>
Thu, 18 Jul 2019 13:29:03 +0000 (15:29 +0200)
Previously when switching modes, the code didn't check if we were in the
correct view for the masking mode.

Reviewed By: Sergey

Differential Revision: http://developer.blender.org/D5288

source/blender/editors/space_clip/clip_ops.c
source/blender/makesrna/intern/rna_space.c

index 83d8133a99e3ab7011563a2ac331e3703bf8f9e0..45479c4253d39bf02cac6bcc66c9620d7d9a73ef 100644 (file)
@@ -1515,6 +1515,11 @@ static int mode_set_exec(bContext *C, wmOperator *op)
 
   sc->mode = mode;
 
+  if (sc->mode == SC_MODE_MASKEDIT && sc->view != SC_VIEW_CLIP) {
+    /* Make sure we are in the right view for mask editing */
+    sc->view = SC_VIEW_CLIP;
+  }
+
   WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CLIP, NULL);
 
   return OPERATOR_FINISHED;
index 2ba5e2ae68c7785c6876b96845c69c71172be5d8..6dc0cf045cdb33d50ace29115d3a84abf3074434 100644 (file)
@@ -2105,6 +2105,13 @@ static void rna_SpaceClipEditor_clip_mode_update(Main *UNUSED(bmain),
 {
   SpaceClip *sc = (SpaceClip *)(ptr->data);
 
+  if (sc->mode == SC_MODE_MASKEDIT && sc->view != SC_VIEW_CLIP) {
+    /* Make sure we are in the right view for mask editing */
+    sc->view = SC_VIEW_CLIP;
+    ScrArea *sa = rna_area_from_space(ptr);
+    ED_area_tag_refresh(sa);
+  }
+
   sc->scopes.ok = 0;
 }