Fix crash when changing proxy storage type for editing (was own
authorAntony Riakiotakis <kalast@gmail.com>
Tue, 7 Apr 2015 14:08:46 +0000 (16:08 +0200)
committerAntony Riakiotakis <kalast@gmail.com>
Tue, 7 Apr 2015 14:08:46 +0000 (16:08 +0200)
stupidity casting from Scene to Editing in RNA)

Move versioning for proxy storage to multiview version check (not really
correct but it was orphaned before and it doesn't hurt either).

source/blender/blenloader/intern/versioning_270.c
source/blender/makesrna/intern/rna_sequencer.c

index 70c7cc9e878d1ea84c90f8cf366d4816643e0c0b..1b91d3d869e7d778518d19ede97ab77a02c21943 100644 (file)
@@ -708,28 +708,6 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
                } FOREACH_NODETREE_END
        }
 
-       if (!DNA_struct_elem_find(fd->filesdna, "Sequence", "char", "storage")) {
-               Scene *scene;
-               Sequence *seq;
-
-#define SEQ_USE_PROXY_CUSTOM_DIR (1 << 19)
-#define SEQ_USE_PROXY_CUSTOM_FILE (1 << 21)
-
-               for (scene = main->scene.first; scene; scene = scene->id.next) {
-                       SEQ_BEGIN (scene->ed, seq) {
-                               if (seq->strip && seq->strip->proxy) {
-                                       if (seq->flag & SEQ_USE_PROXY_CUSTOM_DIR)
-                                               seq->strip->proxy->storage = SEQ_STORAGE_PROXY_CUSTOM_DIR;
-                                       if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE)
-                                               seq->strip->proxy->storage = SEQ_STORAGE_PROXY_CUSTOM_FILE;
-                               }
-                       }
-                       SEQ_END
-               }
-#undef SEQ_USE_PROXY_CUSTOM_DIR
-#undef SEQ_USE_PROXY_CUSTOM_FILE
-       }
-
        if (!MAIN_VERSION_ATLEAST(main, 274, 4)) {
                SceneRenderView *srv;
                wmWindowManager *wm;
@@ -753,6 +731,18 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
                        SEQ_BEGIN (scene->ed, seq)
                        {
                                seq->stereo3d_format = MEM_callocN(sizeof(Stereo3dFormat), "Stereo Display 3d Format");
+
+#define SEQ_USE_PROXY_CUSTOM_DIR (1 << 19)
+#define SEQ_USE_PROXY_CUSTOM_FILE (1 << 21)
+                               if (seq->strip && seq->strip->proxy && !seq->strip->proxy->storage) {
+                                       if (seq->flag & SEQ_USE_PROXY_CUSTOM_DIR)
+                                               seq->strip->proxy->storage = SEQ_STORAGE_PROXY_CUSTOM_DIR;
+                                       if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE)
+                                               seq->strip->proxy->storage = SEQ_STORAGE_PROXY_CUSTOM_FILE;
+                               }
+#undef SEQ_USE_PROXY_CUSTOM_DIR
+#undef SEQ_USE_PROXY_CUSTOM_FILE
+
                        }
                        SEQ_END
                }
index ee4ec1cb6598bb9c728cb5330a38a3e9d09a946c..052744a9864124ecc908194193d9e620165c6dbf 100644 (file)
@@ -135,9 +135,9 @@ static void rna_SequenceEditor_sequences_all_begin(CollectionPropertyIterator *i
        rna_iterator_listbase_begin(iter, &ed->seqbase, NULL);
 }
 
-static void rna_SequenceEditor_update_cache(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
+static void rna_SequenceEditor_update_cache(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
 {
-       Editing *ed = (Editing *) ptr->id.data;
+       Editing *ed = scene->ed;
 
        BKE_sequencer_free_imbuf(scene, &ed->seqbase, false);
 }