From cd6f93bdc905e811da79df64f8016d5d27b6ad72 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 23 Aug 2011 12:33:45 +0000 Subject: vgroup_modifiers: Definitively removed addtionnal mapping/clamping options in WeightVGEdit mod, including from DNA struct. --- source/blender/modifiers/intern/MOD_weightvgedit.c | 55 ++-------------------- 1 file changed, 5 insertions(+), 50 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_weightvgedit.c') diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c index a8d51cee092..a1057bdbbbb 100644 --- a/source/blender/modifiers/intern/MOD_weightvgedit.c +++ b/source/blender/modifiers/intern/MOD_weightvgedit.c @@ -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); -- cgit v1.2.3