diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-04-20 20:12:39 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-04-20 20:12:39 +0400 |
commit | 37542017209bf831235fb1645d31b0275642da87 (patch) | |
tree | 534dc377a36a459ce5ab2aefffa148b7624e4b4c /source | |
parent | ed4377faa76f67ee10fd7e374da0c6f5f120c0fe (diff) |
fix for crash getting the current material & more verbose library errors
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index f3096cdf8f2..3b6a10c0872 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -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 */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 99891fb62e2..96b09f17d5c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -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); |