Fix T54581: Clip editor doesn't synchronize frame on layout change
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 24 Jan 2019 09:36:42 +0000 (10:36 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 24 Jan 2019 09:36:42 +0000 (10:36 +0100)
source/blender/editors/space_clip/space_clip.c

index 31a6ff5bc4b777e6414b9c88e198b3e65c572dc8..f90499ef6bcbb03db65cbb99400961d613d7fa44 100644 (file)
@@ -227,6 +227,12 @@ static void clip_scopes_check_gpencil_change(ScrArea *sa)
        }
 }
 
+static void clip_area_sync_frame_from_scene(ScrArea *sa, Scene *scene)
+{
+       SpaceClip *space_clip = (SpaceClip *)sa->spacedata.first;
+       BKE_movieclip_user_set_frame(&space_clip->user, scene->r.cfra);
+}
+
 /* ******************** default callbacks for clip space ***************** */
 
 static SpaceLink *clip_new(const ScrArea *sa, const Scene *scene)
@@ -324,7 +330,7 @@ static SpaceLink *clip_duplicate(SpaceLink *sl)
        return (SpaceLink *)scn;
 }
 
-static void clip_listener(wmWindow *UNUSED(win), ScrArea *sa, wmNotifier *wmn, Scene *UNUSED(scene))
+static void clip_listener(wmWindow *UNUSED(win), ScrArea *sa, wmNotifier *wmn, Scene *scene)
 {
        /* context changes */
        switch (wmn->category) {
@@ -389,6 +395,9 @@ static void clip_listener(wmWindow *UNUSED(win), ScrArea *sa, wmNotifier *wmn, S
                                case ND_ANIMPLAY:
                                        ED_area_tag_redraw(sa);
                                        break;
+                               case ND_LAYOUTSET:
+                                       clip_area_sync_frame_from_scene(sa, scene);
+                                       break;
                        }
                        break;
                case NC_SPACE: