Page MenuHome

MOD_Lattice_v3.diff

MOD_Lattice_v3.diff

Index: release/scripts/startup/bl_ui/properties_data_modifier.py
===================================================================
--- /Users/patrickboelens/Desktop/properties_data_modifier.py (revision 44979)
+++ /Users/patrickboelens/Desktop/properties_data_modifier.py (working copy)
@@ -318,6 +318,9 @@ class DATA_PT_modifiers(ModifierButtonsP
col = split.column()
col.label(text="Vertex Group:")
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
+
+ layout.separator()
+ layout.prop(md, "influence", slider=True)
def MASK(self, layout, ob, md):
split = layout.split()
Index: source/blender/modifiers/intern/MOD_lattice.c
===================================================================
--- source/blender/modifiers/intern/MOD_lattice.c (revision 44979)
+++ source/blender/modifiers/intern/MOD_lattice.c (working copy)
@@ -49,6 +49,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 +120,7 @@
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 +151,7 @@
/* deformMatricesEM */ NULL,
/* applyModifier */ NULL,
/* applyModifierEM */ NULL,
- /* initData */ NULL,
+ /* initData */ initData,
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ isDisabled,
Index: source/blender/blenkernel/intern/lattice.c
===================================================================
--- source/blender/blenkernel/intern/lattice.c (revision 44979)
+++ source/blender/blenkernel/intern/lattice.c (working copy)
@@ -153,7 +153,7 @@
copy_m4_m4(mat, ltOb->obmat);
unit_m4(ltOb->obmat);
- lattice_deform_verts(ltOb, NULL, NULL, vertexCos, uNew*vNew*wNew, NULL);
+ lattice_deform_verts(ltOb, NULL, NULL, vertexCos, uNew*vNew*wNew, NULL, 1.0f);
copy_m4_m4(ltOb->obmat, mat);
lt->typeu = typeu;
@@ -782,7 +782,7 @@
}
void lattice_deform_verts(Object *laOb, Object *target, DerivedMesh *dm,
- float (*vertexCos)[3], int numVerts, const char *vgroup)
+ float (*vertexCos)[3], int numVerts, const char *vgroup, float influence)
{
int a;
int use_vgroups;
@@ -819,12 +819,12 @@
weight= defvert_find_weight(dvert, index);
if (weight > 0.0f)
- calc_latt_deform(laOb, vertexCos[a], weight);
+ calc_latt_deform(laOb, vertexCos[a], weight*influence);
}
}
} else {
for (a = 0; a < numVerts; a++) {
- calc_latt_deform(laOb, vertexCos[a], 1.0f);
+ calc_latt_deform(laOb, vertexCos[a], influence);
}
}
end_latt_deform(laOb);
@@ -837,7 +837,7 @@
for (dl=dispbase->first; dl; dl=dl->next) {
lattice_deform_verts(ob->parent, ob, NULL,
- (float(*)[3]) dl->verts, dl->nr, NULL);
+ (float(*)[3]) dl->verts, dl->nr, NULL, 1.0f);
}
return 1;
Index: source/blender/blenkernel/BKE_lattice.h
===================================================================
--- source/blender/blenkernel/BKE_lattice.h (revision 44979)
+++ source/blender/blenkernel/BKE_lattice.h (working copy)
@@ -63,7 +63,7 @@
void lattice_deform_verts(struct Object *laOb, struct Object *target,
struct DerivedMesh *dm, float (*vertexCos)[3],
- int numVerts, const char *vgroup);
+ int numVerts, const char *vgroup, float influence);
void armature_deform_verts(struct Object *armOb, struct Object *target,
struct DerivedMesh *dm, float (*vertexCos)[3],
float (*defMats)[3][3], int numVerts, int deformflag,
Index: source/blender/makesdna/DNA_modifier_types.h
===================================================================
--- source/blender/makesdna/DNA_modifier_types.h (revision 44979)
+++ source/blender/makesdna/DNA_modifier_types.h (working copy)
@@ -135,6 +135,9 @@
struct Object *object;
char name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */
+ char pad[4];
+ float influence;
+
} LatticeModifierData;
typedef struct CurveModifierData { \
Index: source/blender/makesrna/intern/rna_modifier.c
===================================================================
--- source/blender/makesrna/intern/rna_modifier.c (revision 44979)
+++ source/blender/makesrna/intern/rna_modifier.c (working copy)
@@ -960,6 +960,13 @@
"Name of Vertex Group which determines influence of modifier per point");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_LatticeModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0, 1, 10, 2);
+ RNA_def_property_ui_text(prop, "Influence", "Strength of modifier effect");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
}
static void rna_def_modifier_curve(BlenderRNA *brna)
Index: source/blender/blenloader/intern/readfile.c
===================================================================
--- source/blender/blenloader/intern/readfile.c (revision 44979)
+++ source/blender/blenloader/intern/readfile.c (working copy)
@@ -13292,6 +13292,21 @@
}
}
+ if (main->versionfile < 262 || (main->versionfile == 262 && main->subversionfile < 3))
+ {
+ Object *ob;
+ ModifierData *md;
+
+ for(ob = main->object.first; ob; ob = ob->id.next) {
+ for(md=ob->modifiers.first; md; md=md->next) {
+ if(md->type == eModifierType_Lattice) {
+ LatticeModifierData *lmd = (LatticeModifierData *)md;
+ lmd->influence = 1.0f;
+ }
+ }
+ }
+ }
+
{
/* Default for old files is to save particle rotations to pointcache */
ParticleSettings *part;

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
0d/4b/d689ce9cd9c00b4eee11895331eb

Event Timeline