diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-08-31 21:22:54 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-08-31 21:23:02 +0300 |
commit | 53ae9b10342e16a0a8767180f701af426e6922f7 (patch) | |
tree | eee0c5e0e4190a59370ff959ea274cb082d55678 /source/blender/editors/mesh | |
parent | 6ae09dfcad8ba7e807d4f8e13ef8f3dbc49e3756 (diff) |
MESH_OT_blend_from_shape: Add error when no selected vertex
This is just something simple I caught while testing the patch for multi-object.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 9808f9f4a82..2de781e08e0 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -3152,6 +3152,7 @@ static int edbm_blend_from_shape_exec(bContext *C, wmOperator *op) kb_ref = BLI_findlink(&key_ref->block, shape_ref); } + int tot_selected_verts_objects = 0; uint objects_len = 0; Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len); for (uint ob_index = 0; ob_index < objects_len; ob_index++) { @@ -3165,6 +3166,7 @@ static int edbm_blend_from_shape_exec(bContext *C, wmOperator *op) if (em->bm->totvertsel == 0) { continue; } + tot_selected_verts_objects++; if (!key) { continue; @@ -3202,6 +3204,12 @@ static int edbm_blend_from_shape_exec(bContext *C, wmOperator *op) } } MEM_freeN(objects); + + if (tot_selected_verts_objects == 0) { + BKE_report(op->reports, RPT_ERROR, "No selected vertex"); + return OPERATOR_CANCELLED; + } + return OPERATOR_FINISHED; } |