[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39338] branches/soc-2011-radish/source/ blender/editors/sculpt_paint/paint_vertex.c: Change two if-else statements to just if' s since the conditions were initially for testing.
Jason Hays
jason_hays22 at mymail.eku.edu
Fri Aug 12 17:42:17 CEST 2011
Revision: 39338
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39338
Author: jason_hays22
Date: 2011-08-12 15:42:16 +0000 (Fri, 12 Aug 2011)
Log Message:
-----------
Change two if-else statements to just if's since the conditions were initially for testing.
Modified Paths:
--------------
branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_vertex.c
Modified: branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_vertex.c
===================================================================
--- branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_vertex.c 2011-08-12 14:57:19 UTC (rev 39337)
+++ branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_vertex.c 2011-08-12 15:42:16 UTC (rev 39338)
@@ -1446,6 +1446,7 @@
}
/*Jason*/
/* fresh start to make multi-paint and locking modular */
+/* returns TRUE if it thinks you need to reset the weights due to normalizing while multi-painting */
static int apply_mp_lcks_normalize(Object *ob, Mesh *me, int index, MDeformWeight *dw, MDeformWeight *tdw, int defcnt, float change, float oldChange, float oldw, float neww, char *selection, int selected, char *bone_groups, char *validmap, char *flags, int multipaint) {
MDeformVert *dvert = me->dvert+index;
MDeformVert *dv = MEM_mallocN(sizeof (*(me->dvert+index)), "oldMDeformVert");
@@ -1473,21 +1474,13 @@
if(oldChange && multipaint && selected > 1) {
if(tdw->weight != oldw) {
if( neww > oldw ) {
- if(tdw->weight > oldw) {
- //printf("should have changed\n");
- } else {
- //printf("should not have changed\n");
- //reset_to_prev(dv, dvert);
+ if(tdw->weight <= oldw) {
MEM_freeN(dv->dw);
MEM_freeN(dv);
return TRUE;
}
} else {
- if(tdw->weight < oldw) {
- //printf("should have changed\n");
- } else {
- //printf("should not have changed\n");
- //reset_to_prev(dv, dvert);
+ if(tdw->weight >= oldw) {
MEM_freeN(dv->dw);
MEM_freeN(dv);
return TRUE;
@@ -1631,8 +1624,11 @@
testw = tuw->weight*change;
if( testw > tuw->weight ) {
if(change > oldChange) {
+ // reset the weights and use the new change
reset_to_prev(wp->wpaint_prev+index, me->dvert+index);
} else {
+ // the old change was more significant,
+ // so set the change to 0 so that it will not do another multi-paint
change = 0;
}
} else {
More information about the Bf-blender-cvs
mailing list