From f3a1ca1872cfbf356a76d2a82bbb20e7b6fb89ae Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 31 Aug 2018 14:20:05 -0300 Subject: [PATCH] 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. --- source/blender/editors/mesh/editmesh_tools.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 ?