diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-08-31 20:20:05 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-08-31 20:21:35 +0300 |
commit | f3a1ca1872cfbf356a76d2a82bbb20e7b6fb89ae (patch) | |
tree | 528b0b8625c1685b0b25ac935d3cef01c42a7a75 /source/blender/editors/mesh | |
parent | 3a43528274224daa2965d1cb42607216f49f2d7d (diff) |
MESH_OT_shape_propagate_to_all: 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 | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index bd6029c626a..c544e590606 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -3056,6 +3056,7 @@ static int edbm_shape_propagate_to_all_exec(bContext *C, wmOperator *op) { ViewLayer *view_layer = CTX_data_view_layer(C); int tot_shapekeys = 0; + 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); @@ -3064,6 +3065,11 @@ static int edbm_shape_propagate_to_all_exec(bContext *C, wmOperator *op) Mesh *me = obedit->data; BMEditMesh *em = me->edit_btmesh; + if (em->bm->totvertsel == 0) { + continue; + } + tot_selected_verts_objects++; + if (shape_propagate(em)){ tot_shapekeys++; }; @@ -3072,7 +3078,11 @@ static int edbm_shape_propagate_to_all_exec(bContext *C, wmOperator *op) } MEM_freeN(objects); - if (tot_shapekeys == 0){ + if (tot_selected_verts_objects == 0) { + BKE_report(op->reports, RPT_ERROR, "No selected vertex"); + return OPERATOR_CANCELLED; + } + else if (tot_shapekeys == 0){ BKE_report(op->reports, RPT_ERROR, objects_len > 1 ? |