diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-08-29 00:51:30 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-08-29 00:51:30 +0400 |
commit | 6f80bff0e2390f3e93ee31967e7ada417c7ba0c3 (patch) | |
tree | c5b3f08415918357330d1d5bf0d3519f6d07cb07 /source | |
parent | a179d16550d15a4543aef940d515ae039ce43e45 (diff) |
2.5: fix bug in ID property loading, which also loading python
RNA collections saves as ID properties.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 1a811ebc08a..89dfa4e2557 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1373,12 +1373,10 @@ static void IDP_DirectLinkIDPArray(IDProperty *prop, int switch_endian, FileData 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 @@ static void IDP_DirectLinkArray(IDProperty *prop, int switch_endian, FileData *f 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]); } |