diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-06-24 17:29:37 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-06-24 17:29:37 +0300 |
commit | 187c696caee13aaa27ecd03a9c17a0d2af28a938 (patch) | |
tree | 037cec5158c8c2e0b4ca9e9202f0b1032c5b6df2 /source/blender/editors/mesh/editmesh_tools.c | |
parent | b617a233aa2c5389c53d1308ea019b4bdc9fb615 (diff) |
Fix T66030: [CRASH] Modifying Normals with Skin Modifier.
clnor editing code was simply not checking at all whether it has
something to work on... Guess nobody had idea to edit custom normals on
a mesh that has no normals before! :P
This should probably be handled in a poll function too, to completely
disable those tools when there are no faces/loops, but let's keep it to
minimal changes at that point.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_tools.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 48cc46f5060..26d830ccaec 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -8571,6 +8571,10 @@ static int edbm_normals_tools_exec(bContext *C, wmOperator *op) BMEditMesh *em = BKE_editmesh_from_object(obedit); BMesh *bm = em->bm; + if (bm->totloop == 0) { + return OPERATOR_CANCELLED; + } + const int mode = RNA_enum_get(op->ptr, "mode"); const bool absolute = RNA_boolean_get(op->ptr, "absolute"); |