Fix wrong material indicated in the error message when baking
The material displayed in the error message due to the lack of active texture was that of the previous slot.
This commit is contained in:
parent
91d7f5d246
commit
34b28850bf
Notes:
blender-bot
2023-02-14 08:06:33 +01:00
Referenced by issue #75427, UI/material index bug related to shader node, cycles baking.
|
@ -446,7 +446,8 @@ static bool bake_object_check(ViewLayer *view_layer, Object *ob, ReportList *rep
|
|||
for (i = 0; i < ob->totcol; i++) {
|
||||
bNodeTree *ntree = NULL;
|
||||
bNode *node = NULL;
|
||||
ED_object_get_active_image(ob, i + 1, &image, NULL, &node, &ntree);
|
||||
const int mat_nr = i + 1;
|
||||
ED_object_get_active_image(ob, mat_nr, &image, NULL, &node, &ntree);
|
||||
|
||||
if (image) {
|
||||
ImBuf *ibuf;
|
||||
|
@ -481,7 +482,7 @@ static bool bake_object_check(ViewLayer *view_layer, Object *ob, ReportList *rep
|
|||
}
|
||||
}
|
||||
else {
|
||||
Material *mat = BKE_object_material_get(ob, i);
|
||||
Material *mat = BKE_object_material_get(ob, mat_nr);
|
||||
if (mat != NULL) {
|
||||
BKE_reportf(reports,
|
||||
RPT_INFO,
|
||||
|
|
Loading…
Reference in New Issue