fix for crash getting the current material & more verbose library errors
This commit is contained in:
@@ -451,7 +451,7 @@ Material *give_current_material(Object *ob, int act)
|
||||
if(act>ob->totcol) act= ob->totcol;
|
||||
else if(act<=0) act= 1;
|
||||
|
||||
if(ob->matbits[act-1]) { /* in object */
|
||||
if(ob->matbits && ob->matbits[act-1]) { /* in object */
|
||||
ma= ob->mat[act-1];
|
||||
}
|
||||
else { /* in data */
|
||||
|
||||
@@ -12257,7 +12257,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
|
||||
|
||||
append_id_part(fd, mainptr, id, &realid);
|
||||
if (!realid) {
|
||||
printf("LIB ERROR: can't find %s\n", id->name);
|
||||
printf("LIB ERROR: %s:'%s' missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
|
||||
BKE_reportf(fd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
|
||||
}
|
||||
|
||||
@@ -12293,9 +12293,8 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
|
||||
ID *idn= id->next;
|
||||
if(id->flag & LIB_READ) {
|
||||
BLI_remlink(lbarray[a], id);
|
||||
|
||||
printf("LIB ERROR: can't find %s\n", id->name);
|
||||
BKE_reportf(basefd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
|
||||
printf("LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
|
||||
BKE_reportf(basefd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
|
||||
change_idid_adr(mainlist, basefd, id, NULL);
|
||||
|
||||
MEM_freeN(id);
|
||||
|
||||
Reference in New Issue
Block a user