Fix T53808: VSE doesn't show scene strip markers
authorCampbell Barton <ideasman42@gmail.com>
Thu, 18 Jan 2018 03:49:09 +0000 (14:49 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 18 Jan 2018 03:49:09 +0000 (14:49 +1100)
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenloader/intern/readfile.c
source/blender/makesdna/DNA_scene_types.h

index 0baf611b29344a2098000171b5178232f96f3d6e..126761ed14bc17b4080815f9c852f3304be1847e 100644 (file)
@@ -1139,6 +1139,10 @@ Object *BKE_scene_camera_find(Scene *sc)
 #ifdef DURIAN_CAMERA_SWITCH
 Object *BKE_scene_camera_switch_find(Scene *scene)
 {
+       if (scene->r.mode & R_NO_CAMERA_SWITCH) {
+               return NULL;
+       }
+
        TimeMarker *m;
        int cfra = scene->r.cfra;
        int frame = -(MAXFRAME + 1);
index b3db2080cb8c039c7e49e3b6ee2576dad61d9afa..5066759f343c17d0f666517f06fb7713ab80cc7b 100644 (file)
@@ -3199,11 +3199,12 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq
                int scemode;
                int cfra;
                float subframe;
+
 #ifdef DURIAN_CAMERA_SWITCH
-               ListBase markers;
+               int mode;
 #endif
        } orig_data;
-       
+
        /* Old info:
         * Hack! This function can be called from do_render_seq(), in that case
         * the seq->scene can already have a Render initialized with same name,
@@ -3263,7 +3264,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq
        orig_data.cfra = scene->r.cfra;
        orig_data.subframe = scene->r.subframe;
 #ifdef DURIAN_CAMERA_SWITCH
-       orig_data.markers = scene->markers;
+       orig_data.mode = scene->r.mode;
 #endif
 
        BKE_scene_frame_set(scene, frame);
@@ -3286,10 +3287,10 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq
 
        /* prevent eternal loop */
        scene->r.scemode &= ~R_DOSEQ;
-       
+
 #ifdef DURIAN_CAMERA_SWITCH
        /* stooping to new low's in hackyness :( */
-       BLI_listbase_clear(&scene->markers);
+       scene->r.mode |= R_NO_CAMERA_SWITCH;
 #endif
 
        is_frame_update = (orig_data.cfra != scene->r.cfra) || (orig_data.subframe != scene->r.subframe);
@@ -3409,7 +3410,7 @@ finally:
 
 #ifdef DURIAN_CAMERA_SWITCH
        /* stooping to new low's in hackyness :( */
-       scene->markers = orig_data.markers;
+       scene->r.mode &= ~(orig_data.mode & R_NO_CAMERA_SWITCH);
 #endif
 
        return ibuf;
index 39f83062401b3b615ff7334e97f4d19997ac0658..08830242279aa28533f278d425bb1e7a9ddfe543 100644 (file)
@@ -6174,7 +6174,12 @@ static void direct_link_scene(FileData *fd, Scene *sce)
                        }
                }
        }
-       
+
+#ifdef DURIAN_CAMERA_SWITCH
+       /* Runtime */
+       sce->r.mode &= ~R_NO_CAMERA_SWITCH;
+#endif
+
        sce->r.avicodecdata = newdataadr(fd, sce->r.avicodecdata);
        if (sce->r.avicodecdata) {
                sce->r.avicodecdata->lpFormat = newdataadr(fd, sce->r.avicodecdata->lpFormat);
index 1ce94fb226fb07fdb8e8fcbce824d537d442f973..1cc5cbf8c423f5fdca76bdfb0a31f5fca29f6838 100644 (file)
@@ -1729,7 +1729,8 @@ typedef struct Scene {
 #define R_BORDER               0x0200
 #define R_PANORAMA             0x0400  /* deprecated as scene option, still used in renderer */
 #define R_CROP                 0x0800
-/*#define R_COSMO                      0x1000 deprecated */
+               /* Disable camera switching: runtime (DURIAN_CAMERA_SWITCH) */
+#define R_NO_CAMERA_SWITCH     0x1000
 #define R_ODDFIELD             0x2000
 #define R_MBLUR                        0x4000
                /* unified was here */