vgroup_modifiers: Definitively removed addtionnal mapping/clamping options in WeightVGEdit mod, including from DNA struct.

This commit is contained in:
Bastien Montagne
2011-08-23 12:33:45 +00:00
parent 2dee23fad4
commit cd6f93bdc9
2 changed files with 5 additions and 55 deletions

View File

@@ -803,16 +803,11 @@ typedef struct WeightVGEditModifierData {
float default_weight; /* Weight for vertices not in vgroup. */
/* Mapping stuff. */
float map_org_min, map_org_max; /* Deprecated, keeping for file compatibility for now... */
float map_new_min, map_new_max; /* Deprecated, keeping for file compatibility for now... */
struct CurveMapping *cmap_curve; /* The custom mapping curve! */
/* The add/remove vertices weight thresholds. */
float add_threshold, rem_threshold;
/* Clamping options. */
float clamp_weight_min, clamp_weight_max; /* Deprecated, keeping for file compatibility for now... */
/* Masking options. */
float mask_constant; /* The global “influence”, if no vgroup nor tex is used as mask. */
/* Name of mask vertex group from which to get weight factors. */

View File

@@ -64,18 +64,11 @@ static void initData(ModifierData *md)
wmd->edit_flags = 0;
wmd->default_weight = 0.0f;
/* wmd->map_org_min = 0.0f;*/
/* wmd->map_org_max = 1.0f;*/
/* wmd->map_new_min = 0.0f;*/
/* wmd->map_new_max = 1.0f;*/
wmd->cmap_curve = curvemapping_add(1, 0.0, 0.0, 1.0, 1.0);
curvemapping_initialize(wmd->cmap_curve);
/* wmd->clamp_weight_min = 0.0f;*/
/* wmd->clamp_weight_max = 1.0f;*/
wmd->add_threshold = 0.01f;
wmd->rem_threshold = 0.01f;
wmd->add_threshold = 0.01f;
wmd->mask_constant = 1.0f;
wmd->mask_tex_use_channel = MOD_WVG_MASK_TEX_USE_INT; /* Use intensity by default. */
@@ -98,15 +91,8 @@ static void copyData(ModifierData *md, ModifierData *target)
twmd->edit_flags = wmd->edit_flags;
twmd->default_weight = wmd->default_weight;
/* twmd->map_org_min = wmd->map_org_min;*/
/* twmd->map_org_max = wmd->map_org_max;*/
/* twmd->map_new_min = wmd->map_new_min;*/
/* twmd->map_new_max = wmd->map_new_max;*/
twmd->cmap_curve = curvemapping_copy(wmd->cmap_curve);
/* twmd->clamp_weight_min = wmd->clamp_weight_min;*/
/* twmd->clamp_weight_max = wmd->clamp_weight_max;*/
twmd->add_threshold = wmd->add_threshold;
twmd->rem_threshold = wmd->rem_threshold;
@@ -208,12 +194,9 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
char rel_ret = 0; /* Boolean, whether we have to release ret dm or not, when not using it! */
float *mapf = NULL; /* Cache for mapping factors. */
/* Flags. */
/* char do_map = wmd->edit_flags & MOD_WVG_EDIT_MAP;*/
char do_cmap = wmd->edit_flags & MOD_WVG_EDIT_CMAP;
/* char do_rev = wmd->edit_flags & MOD_WVG_EDIT_REVERSE_WEIGHTS;*/
char do_add = wmd->edit_flags & MOD_WVG_EDIT_ADD2VG;
char do_rem = wmd->edit_flags & MOD_WVG_EDIT_REMFVG;
/* char do_clamp = wmd->edit_flags & MOD_WVG_EDIT_CLAMP;*/
char do_map = wmd->edit_flags & MOD_WVG_EDIT_CMAP;
char do_add = wmd->edit_flags & MOD_WVG_EDIT_ADD2VG;
char do_rem = wmd->edit_flags & MOD_WVG_EDIT_REMFVG;
/* Get number of verts. */
numVerts = dm->getNumVerts(dm);
@@ -286,30 +269,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
}
}
/* Do mapping. */
#if 0
if (do_map) {
/* This mapping is a simple func: a*in + b.
* with a = (out_min - out_max)/(in_min - in_max)
* and b = out_max - a*in_max
* Note a and b are cached!
*/
if (mapf == NULL) {
float denom = wmd->map_org_min - wmd->map_org_max;
mapf = MEM_mallocN(sizeof(float) * 2, "WeightVGEdit, mapf");
if (denom > 0.0 && denom < MOD_WVG_ZEROFLOOR)
denom = MOD_WVG_ZEROFLOOR;
else if (denom < 0.0 && denom > -MOD_WVG_ZEROFLOOR)
denom = -MOD_WVG_ZEROFLOOR;
mapf[0] = (wmd->map_new_min - wmd->map_new_max) / denom;
mapf[1] = wmd->map_new_max - (mapf[0] * wmd->map_org_max);
}
new_w[i] = (mapf[0] * new_w[i]) + mapf[1];
}
#endif
if (do_cmap)
if (do_map)
new_w[i] = curvemapping_evaluateF(wmd->cmap_curve, 0, new_w[i]);
/* if (do_rev)*/
/* new_w[i] = (-1.0 * new_w[i]) + 1.0;*/
}
/* Do masking. */
@@ -317,12 +278,6 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
wmd->mask_defgrp_name, wmd->mask_texture, wmd->mask_tex_use_channel,
wmd->mask_tex_mapping, wmd->mask_tex_map_obj, wmd->mask_tex_uvlayer_name);
/* Do clamping. */
/* if (do_clamp) {*/
/* for (i = 0; i < numVerts; i++)*/
/* CLAMP(org_w[i], wmd->clamp_weight_min, wmd->clamp_weight_max);*/
/* }*/
/* Update/add/remove from vgroup. */
weightvg_update_vg(dvert, defgrp_idx, numVerts, NULL, org_w, do_add, wmd->add_threshold,
do_rem, wmd->rem_threshold);