[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39651] branches/vgroup_modifiers/source/ blender: vgroup_modifiers: Definitively removed addtionnal mapping/ clamping options in WeightVGEdit mod, including from DNA struct.
Bastien Montagne
montagne29 at wanadoo.fr
Tue Aug 23 14:33:45 CEST 2011
Revision: 39651
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39651
Author: mont29
Date: 2011-08-23 12:33:45 +0000 (Tue, 23 Aug 2011)
Log Message:
-----------
vgroup_modifiers: Definitively removed addtionnal mapping/clamping options in WeightVGEdit mod, including from DNA struct.
Modified Paths:
--------------
branches/vgroup_modifiers/source/blender/makesdna/DNA_modifier_types.h
branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_weightvgedit.c
Modified: branches/vgroup_modifiers/source/blender/makesdna/DNA_modifier_types.h
===================================================================
--- branches/vgroup_modifiers/source/blender/makesdna/DNA_modifier_types.h 2011-08-23 12:20:11 UTC (rev 39650)
+++ branches/vgroup_modifiers/source/blender/makesdna/DNA_modifier_types.h 2011-08-23 12:33:45 UTC (rev 39651)
@@ -803,16 +803,11 @@
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. */
Modified: branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_weightvgedit.c
===================================================================
--- branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_weightvgedit.c 2011-08-23 12:20:11 UTC (rev 39650)
+++ branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_weightvgedit.c 2011-08-23 12:33:45 UTC (rev 39651)
@@ -64,18 +64,11 @@
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 @@
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 @@
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 @@
}
}
/* 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 @@
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);
More information about the Bf-blender-cvs
mailing list