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:
authorBastien Montagne <montagne29@wanadoo.fr>2011-07-26 22:51:35 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2011-07-26 22:51:35 +0400
commitaf286ac95b5dbd0a09e433ba672c75f126b206c2 (patch)
tree8525567c4a67a0fcfd6b833a617a369a0829e149
parent07dc73fa3139622853391b740f1ebcafe5d48014 (diff)
vgroup_modifiers: Addressed most ideasman’s remarks and suggestions in his last review.
*Removed curve init code in readfile (no more needed since the split broke anyway compatibility with earlier WeightVGroup files…). *Updated get_ob2ob_distance() code (much simpler – I’m not a matrices’ god!). *Enhanced a few RNA names (Campbell has others in mind here, though, I think).
-rw-r--r--source/blender/blenloader/intern/readfile.c18
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c12
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgproximity.c15
3 files changed, 9 insertions, 36 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index e21a132d16d..ce4a5d21759 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -11714,24 +11714,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* put compatibility code here until next subversion bump */
{
- Object *ob;
- ModifierData *md;
-
- /* WeightVGEdit modifier: CurveMapping pointer… */
- for(ob = main->object.first; ob; ob = ob->id.next) {
- for(md = ob->modifiers.first; md; md = md->next) {
- if(md->type == eModifierType_WeightVGEdit) {
- WeightVGEditModifierData *wmd = (WeightVGEditModifierData*) md;
- if (wmd->cmap_curve == NULL) {
- wmd->cmap_curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
- curvemapping_initialize(wmd->cmap_curve);
- }
- }
- }
- }
-
}
-
+
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index fff99cbdf15..39d3e5873bb 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -2728,8 +2728,10 @@ static void rna_def_modifier_weightvgmix(BlenderRNA *brna)
static void rna_def_modifier_weightvgproximity(BlenderRNA *brna)
{
static EnumPropertyItem weightvg_proximity_modes_items[] = {
- {MOD_WVG_PROXIMITY_OBJ2OBJDIST, "OBJ2OBJDIST", 0, "O2O Distance", ""},
- {MOD_WVG_PROXIMITY_OBJ2VERTDIST, "OBJ2VERTDIST", 0, "O2V Distance", ""},
+ {MOD_WVG_PROXIMITY_OBJ2OBJDIST, "OBJ2OBJDIST", 0, "Object Distance",
+ "Use distance between affected and target objects."},
+ {MOD_WVG_PROXIMITY_OBJ2VERTDIST, "OBJ2VERTDIST", 0, "Verts Distance",
+ "Use distance between affected object’s vertices and target object, or target object’s geometry."},
{0, NULL, 0, NULL, NULL}};
StructRNA *srna;
@@ -2755,19 +2757,19 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna)
prop= RNA_def_property(srna, "obj2vert_verts", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "proximity_flags", MOD_WVG_PROXIMITY_O2VD_VERTS);
- RNA_def_property_ui_text(prop, "Use Target Vertices",
+ RNA_def_property_ui_text(prop, "Verts as Target",
"Use shortest distance to target object’s vertices as weight.");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "obj2vert_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "proximity_flags", MOD_WVG_PROXIMITY_O2VD_EDGES);
- RNA_def_property_ui_text(prop, "Use Target Edges",
+ RNA_def_property_ui_text(prop, "Edges as Target",
"Use shortest distance to target object’s edges as weight.");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "obj2vert_faces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "proximity_flags", MOD_WVG_PROXIMITY_O2VD_FACES);
- RNA_def_property_ui_text(prop, "Use Target Faces",
+ RNA_def_property_ui_text(prop, "Faces as Target",
"Use shortest distance to target object’s faces as weight.");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c
index 7349d90c1ec..06ffb5e4510 100644
--- a/source/blender/modifiers/intern/MOD_weightvgproximity.c
+++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c
@@ -197,20 +197,7 @@ static void get_vert2ob_distance(int numVerts, float (*v_cos)[3], float *dist,
*/
static float get_ob2ob_distance(const Object* ob, const Object* obr)
{
- /* Both objects coordinates. */
- float o_wco[3],
- o_wro[3][3], /*unused*/
- o_wsz[3], /*unused*/
- or_wco[3],
- or_wro[3][3],/*unused*/
- or_wsz[3]; /*unused*/
- /* Get world-coordinates of both objects (constraints and anim included).
- * We also get rotation and scale, even though we do not want them…
- */
- mat4_to_loc_rot_size(o_wco, o_wro, o_wsz, (float (*)[4])ob->obmat);
- mat4_to_loc_rot_size(or_wco, or_wro, or_wsz, (float (*)[4])obr->obmat);
- /* Return distance between both coordinates. */
- return len_v3v3(o_wco, or_wco);
+ return len_v3v3(ob->obmat[3], obr->obmat[3]);
}
/**************************************