[Bf-blender-cvs] [f9f3c29] master: Fix crash when changing proxy storage type for editing (was own stupidity casting from Scene to Editing in RNA)

Antony Riakiotakis noreply at git.blender.org
Tue Apr 7 16:09:02 CEST 2015


Commit: f9f3c29a3a5b558e09c36076521bdafc91e7e326
Author: Antony Riakiotakis
Date:   Tue Apr 7 16:08:46 2015 +0200
Branches: master
https://developer.blender.org/rBf9f3c29a3a5b558e09c36076521bdafc91e7e326

Fix crash when changing proxy storage type for editing (was own
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).

===================================================================

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

===================================================================

diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 70c7cc9..1b91d3d 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -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
 		}
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index ee4ec1c..052744a 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -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);
 }




More information about the Bf-blender-cvs mailing list