diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2020-04-08 15:44:26 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2020-04-08 15:44:43 +0300 |
commit | 34b28850bf86d674df428cddf0920c2853ebadb9 (patch) | |
tree | d9fbf21f83dc99ff70cdf3b8af8257142490d138 | |
parent | 91d7f5d2463495f20f1e3a985241a2672961ad3f (diff) |
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.
-rw-r--r-- | source/blender/editors/object/object_bake_api.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index d625b770164..debad321583 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -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, |