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!
This commit is contained in:
@@ -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)) {
|
if (BLI_streq(id->name, idread->name)) {
|
||||||
id->flag &= ~LIB_READ;
|
id->flag &= ~LIB_READ;
|
||||||
id->flag |= LIB_TEST;
|
id->flag |= LIB_TEST;
|
||||||
|
// printf("read lib block %s\n", id->name);
|
||||||
read_libblock(fd, mainvar, bhead, id->flag, id_r);
|
read_libblock(fd, mainvar, bhead, id->flag, id_r);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -5649,10 +5650,12 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
|
|||||||
mainptr= mainl->next;
|
mainptr= mainl->next;
|
||||||
while(mainptr) {
|
while(mainptr) {
|
||||||
int tot= mainvar_count_libread_blocks(mainptr);
|
int tot= mainvar_count_libread_blocks(mainptr);
|
||||||
|
|
||||||
|
//printf("found LIB_READ %s\n", mainptr->curlib->name);
|
||||||
if(tot) {
|
if(tot) {
|
||||||
FileData *fd= mainptr->curlib->filedata;
|
FileData *fd= mainptr->curlib->filedata;
|
||||||
|
|
||||||
if(fd==0) {
|
if(fd==NULL) {
|
||||||
printf("read lib %s\n", mainptr->curlib->name);
|
printf("read lib %s\n", mainptr->curlib->name);
|
||||||
fd= blo_openblenderfile(mainptr->curlib->name);
|
fd= blo_openblenderfile(mainptr->curlib->name);
|
||||||
if (fd) {
|
if (fd) {
|
||||||
@@ -5667,7 +5670,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
|
|||||||
}
|
}
|
||||||
else mainptr->curlib->filedata= NULL;
|
else mainptr->curlib->filedata= NULL;
|
||||||
|
|
||||||
if (!fd)
|
if (fd==NULL)
|
||||||
printf("ERROR: can't find lib %s \n", mainptr->curlib->name);
|
printf("ERROR: can't find lib %s \n", mainptr->curlib->name);
|
||||||
}
|
}
|
||||||
if(fd) {
|
if(fd) {
|
||||||
@@ -5694,6 +5697,13 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
|
|||||||
}
|
}
|
||||||
|
|
||||||
expand_main(fd, mainptr);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user