diff options
author | Thomas Dinges <blender@dingto.org> | 2012-03-26 02:14:21 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2012-03-26 02:14:21 +0400 |
commit | aede928bdc7902bb81ebb00b286dc5064cf54dd6 (patch) | |
tree | c85380cf5bcf06bcc7c3162dc661083571d75322 /source/blender/modifiers/intern/MOD_lattice.c | |
parent | c379b78d8a00a0960346656d3e38aacd56974572 (diff) |
Patch: [#30652] Influence slider for Lattice Modifier
* This patch adds a influence slider for the lattice modifier, which affects the strength of the deformation.
Patch by Patrick Boelens (senshi), thanks a lot!
Diffstat (limited to 'source/blender/modifiers/intern/MOD_lattice.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_lattice.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_lattice.c b/source/blender/modifiers/intern/MOD_lattice.c index 35503f9e462..5732fee7826 100644 --- a/source/blender/modifiers/intern/MOD_lattice.c +++ b/source/blender/modifiers/intern/MOD_lattice.c @@ -40,7 +40,6 @@ #include "BLI_utildefines.h" #include "BLI_string.h" - #include "BKE_cdderivedmesh.h" #include "BKE_lattice.h" #include "BKE_modifier.h" @@ -49,6 +48,11 @@ #include "MOD_util.h" +static void initData(ModifierData *md) +{ + LatticeModifierData *lmd = (LatticeModifierData*) md; + lmd->influence = 1.0f; +} static void copyData(ModifierData *md, ModifierData *target) { @@ -115,7 +119,7 @@ static void deformVerts(ModifierData *md, Object *ob, modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */ lattice_deform_verts(lmd->object, ob, derivedData, - vertexCos, numVerts, lmd->name); + vertexCos, numVerts, lmd->name, lmd->influence); } static void deformVertsEM( @@ -146,7 +150,7 @@ ModifierTypeInfo modifierType_Lattice = { /* deformMatricesEM */ NULL, /* applyModifier */ NULL, /* applyModifierEM */ NULL, - /* initData */ NULL, + /* initData */ initData, /* requiredDataMask */ requiredDataMask, /* freeData */ NULL, /* isDisabled */ isDisabled, |