[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22846] branches/blender2.5/blender/source /blender/blenloader/intern/readfile.c: 2.5: fix bug in ID property loading, which also loading python

Brecht Van Lommel brecht at blender.org
Fri Aug 28 22:51:30 CEST 2009


Revision: 22846
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22846
Author:   blendix
Date:     2009-08-28 22:51:30 +0200 (Fri, 28 Aug 2009)

Log Message:
-----------
2.5: fix bug in ID property loading, which also loading python
RNA collections saves as ID properties.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c

Modified: branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c	2009-08-28 20:41:12 UTC (rev 22845)
+++ branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c	2009-08-28 20:51:30 UTC (rev 22846)
@@ -1373,12 +1373,10 @@
 	prop->totallen = prop->len;
 	prop->data.pointer = newdataadr(fd, prop->data.pointer);
 
-	if (switch_endian) {
-		array= (IDProperty*) prop->data.pointer;
+	array= (IDProperty*) prop->data.pointer;
 
-		for(i=0; i<prop->len; i++)
-			IDP_DirectLinkProperty(&array[i], switch_endian, fd);
-	}
+	for(i=0; i<prop->len; i++)
+		IDP_DirectLinkProperty(&array[i], switch_endian, fd);
 }
 
 static void IDP_DirectLinkArray(IDProperty *prop, int switch_endian, FileData *fd)
@@ -1390,19 +1388,22 @@
 	prop->totallen = prop->len;
 	prop->data.pointer = newdataadr(fd, prop->data.pointer);
 
-	if (switch_endian) {
-		if(prop->subtype == IDP_GROUP) {
-			test_pointer_array(fd, prop->data.pointer);
-			array= prop->data.pointer;
+	if(prop->subtype == IDP_GROUP) {
+		test_pointer_array(fd, prop->data.pointer);
+		array= prop->data.pointer;
 
-			for(i=0; i<prop->len; i++)
-				IDP_DirectLinkProperty(array[i], switch_endian, fd);
-		}
-		else if(prop->subtype == IDP_DOUBLE) {
+		for(i=0; i<prop->len; i++)
+			IDP_DirectLinkProperty(array[i], switch_endian, fd);
+	}
+	else if(prop->subtype == IDP_DOUBLE) {
+		if (switch_endian) {
 			for (i=0; i<prop->len; i++) {
 				SWITCH_LONGINT(((double*)prop->data.pointer)[i]);
 			}
-		} else {
+		}
+	}
+	else {
+		if (switch_endian) {
 			for (i=0; i<prop->len; i++) {
 				SWITCH_INT(((int*)prop->data.pointer)[i]);
 			}





More information about the Bf-blender-cvs mailing list