[Bf-blender-cvs] [f3a1ca1872c] blender2.8: MESH_OT_shape_propagate_to_all: Add error when no selected vertex

Dalai Felinto noreply at git.blender.org
Fri Aug 31 19:22:21 CEST 2018


Commit: f3a1ca1872cfbf356a76d2a82bbb20e7b6fb89ae
Author: Dalai Felinto
Date:   Fri Aug 31 14:20:05 2018 -0300
Branches: blender2.8
https://developer.blender.org/rBf3a1ca1872cfbf356a76d2a82bbb20e7b6fb89ae

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.

===================================================================

M	source/blender/editors/mesh/editmesh_tools.c

===================================================================

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 ?



More information about the Bf-blender-cvs mailing list