Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-06-02 13:24:58 +0400
committerTon Roosendaal <ton@blender.org>2005-06-02 13:24:58 +0400
commit9c869b1237a818754e222a31cd33e7a1c5def9cc (patch)
tree2916c2bf8243ea74bee25130ebf52cb97f65186b /source/blender/blenloader/intern
parent25a4b8fa07c813c13e86882c0eaf7a5fae501c98 (diff)
Bug fix #2659
The bugfix for linking recursively from files worked, but there was another bug hidden... only showed up when actually *using* the recursive feature, and not with only testing the bugfix. :) Famous coder error, but yah, we got luckily users to test it! I'v asked the reporter to give it more extensive testing!
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r--source/blender/blenloader/intern/readfile.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 0955fcff1cb..8602092405f 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5458,6 +5458,7 @@ static void append_id_part(FileData *fd, Main *mainvar, ID *id, ID **id_r)
if (BLI_streq(id->name, idread->name)) {
id->flag &= ~LIB_READ;
id->flag |= LIB_TEST;
+// printf("read lib block %s\n", id->name);
read_libblock(fd, mainvar, bhead, id->flag, id_r);
break;
@@ -5649,10 +5650,12 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
mainptr= mainl->next;
while(mainptr) {
int tot= mainvar_count_libread_blocks(mainptr);
+
+ //printf("found LIB_READ %s\n", mainptr->curlib->name);
if(tot) {
FileData *fd= mainptr->curlib->filedata;
- if(fd==0) {
+ if(fd==NULL) {
printf("read lib %s\n", mainptr->curlib->name);
fd= blo_openblenderfile(mainptr->curlib->name);
if (fd) {
@@ -5667,7 +5670,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
}
else mainptr->curlib->filedata= NULL;
- if (!fd)
+ if (fd==NULL)
printf("ERROR: can't find lib %s \n", mainptr->curlib->name);
}
if(fd) {
@@ -5694,6 +5697,13 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
}
expand_main(fd, mainptr);
+
+ /* dang FileData... now new libraries need to be appended to original filedata, it is not a good replacement for the old global (ton) */
+ while( fd->mainlist.first ) {
+ Main *mp= fd->mainlist.first;
+ BLI_remlink(&fd->mainlist, mp);
+ BLI_addtail(&basefd->mainlist, mp);
+ }
}
}