Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormano-wii <germano.costa@ig.com.br>2019-07-02 01:59:40 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-07-02 01:59:40 +0300
commit12788538496a6c63f876926f27a99cf8b0ad9c97 (patch)
tree7c8599b4813caef2d53c2025aadd766eb0ee0f89 /source/blender/editors/object/object_vgroup.c
parent4f321a33739cdb43c3325696d5853cb251e45b1c (diff)
Fix T61360: Smooth Weights affects all objects
Diffstat (limited to 'source/blender/editors/object/object_vgroup.c')
-rw-r--r--source/blender/editors/object/object_vgroup.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index 678f6f50096..4f61443ac54 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -3278,9 +3278,18 @@ static int vertex_group_smooth_exec(bContext *C, wmOperator *op)
ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob_ctx = ED_object_context(C);
- uint objects_len = 0;
- Object **objects = BKE_view_layer_array_from_objects_in_mode_unique_data(
- view_layer, CTX_wm_view3d(C), &objects_len, ob_ctx->mode);
+ uint objects_len;
+ Object **objects;
+ if (ob_ctx->mode == OB_MODE_WEIGHT_PAINT) {
+ /* Until weight paint supports multi-edit, use only the active. */
+ objects_len = 1;
+ objects = &ob_ctx;
+ }
+ else {
+ objects = BKE_view_layer_array_from_objects_in_mode_unique_data(
+ view_layer, CTX_wm_view3d(C), &objects_len, ob_ctx->mode);
+ }
+
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *ob = objects[ob_index];
@@ -3296,7 +3305,9 @@ static int vertex_group_smooth_exec(bContext *C, wmOperator *op)
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data);
}
- MEM_freeN(objects);
+ if (objects != &ob_ctx) {
+ MEM_freeN(objects);
+ }
return OPERATOR_FINISHED;
}