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:
Diffstat (limited to 'source/blender/modifiers/intern/MOD_warp.c')
-rw-r--r--source/blender/modifiers/intern/MOD_warp.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c
index 7155498c942..4a98afbb91c 100644
--- a/source/blender/modifiers/intern/MOD_warp.c
+++ b/source/blender/modifiers/intern/MOD_warp.c
@@ -30,14 +30,14 @@
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
+#include "BKE_colortools.h"
+#include "BKE_deform.h"
#include "BKE_editmesh.h"
-#include "BKE_library.h"
-#include "BKE_library_query.h"
+#include "BKE_lib_id.h"
+#include "BKE_lib_query.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
-#include "BKE_deform.h"
#include "BKE_texture.h"
-#include "BKE_colortools.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
@@ -169,13 +169,13 @@ static void warpModifier_do(WarpModifierData *wmd,
float tmat[4][4];
- const float falloff_radius_sq = SQUARE(wmd->falloff_radius);
+ const float falloff_radius_sq = square_f(wmd->falloff_radius);
float strength = wmd->strength;
float fac = 1.0f, weight;
int i;
int defgrp_index;
MDeformVert *dvert, *dv = NULL;
-
+ const bool invert_vgroup = (wmd->flag & MOD_WARP_INVERT_VGROUP) != 0;
float(*tex_co)[3] = NULL;
if (!(wmd->object_from && wmd->object_to)) {
@@ -235,7 +235,8 @@ static void warpModifier_do(WarpModifierData *wmd,
/* skip if no vert group found */
if (defgrp_index != -1) {
dv = &dvert[i];
- weight = defvert_find_weight(dv, defgrp_index) * strength;
+ weight = invert_vgroup ? 1.0f - BKE_defvert_find_weight(dv, defgrp_index) * strength :
+ BKE_defvert_find_weight(dv, defgrp_index) * strength;
if (weight <= 0.0f) {
continue;
}