Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHabib Gahbiche <habibgahbiche@gmail.com>2021-01-20 17:02:04 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-01-20 20:07:51 +0300
commita823e825c899c30a98dd1c3fe64c5e3d72716921 (patch)
tree244ba732e1140738a74ac35bf50dda67ae27a9fb
parent0d599ce95a8e81c8fe4f2461f49068639e4beb2f (diff)
Fix T84569: crash when trying to bake an object with no faces
Differential Revision: https://developer.blender.org/D10125
-rw-r--r--source/blender/editors/object/object_bake_api.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index 8a63ab22b36..113a0395e8c 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -441,6 +441,12 @@ static bool bake_object_check(ViewLayer *view_layer,
}
Mesh *me = (Mesh *)ob->data;
+
+ if (me->totpoly == 0) {
+ BKE_reportf(reports, RPT_ERROR, "No faces found in the object \"%s\"", ob->id.name + 2);
+ return false;
+ }
+
if (target == R_BAKE_TARGET_VERTEX_COLORS) {
MPropCol *mcol = CustomData_get_layer(&me->vdata, CD_PROP_COLOR);
MLoopCol *mloopcol = CustomData_get_layer(&me->ldata, CD_MLOOPCOL);