From d0cc9b522dfb56e329f894d2c188bdcdfd175609 Mon Sep 17 00:00:00 2001 From: Cody Winchester Date: Tue, 18 Feb 2020 16:28:02 +0100 Subject: Modifiers: Laplacian Smooth modifier add invert vgroup option Adds the invert vgroup option to the Laplacian Smooth modifier. Differential Revision: https://developer.blender.org/D6842 --- source/blender/modifiers/intern/MOD_laplaciansmooth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/modifiers/intern/MOD_laplaciansmooth.c') diff --git a/source/blender/modifiers/intern/MOD_laplaciansmooth.c b/source/blender/modifiers/intern/MOD_laplaciansmooth.c index dbe776ed32a..ea788d3f72b 100644 --- a/source/blender/modifiers/intern/MOD_laplaciansmooth.c +++ b/source/blender/modifiers/intern/MOD_laplaciansmooth.c @@ -378,6 +378,7 @@ static void laplaciansmoothModifier_do( float w, wpaint; int i, iter; int defgrp_index; + const bool invert_vgroup = (smd->flag & MOD_LAPLACIANSMOOTH_INVERT_VGROUP) != 0; sys = init_laplacian_system(mesh->totedge, mesh->totpoly, mesh->totloop, numVerts); if (!sys) { @@ -420,7 +421,8 @@ static void laplaciansmoothModifier_do( EIG_linear_solver_right_hand_side_add(sys->context, 2, i, vertexCos[i][2]); if (iter == 0) { if (dv) { - wpaint = defvert_find_weight(dv, defgrp_index); + wpaint = invert_vgroup ? 1.0f - defvert_find_weight(dv, defgrp_index) : + defvert_find_weight(dv, defgrp_index); dv++; } else { -- cgit v1.2.3