[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47287] trunk/blender/source/blender: This fixes a precision issue in multi-paint so that near zero values do not cause flickering as you paint .

Jason Hays jason_hays22 at mymail.eku.edu
Thu May 31 19:22:52 CEST 2012


Revision: 47287
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47287
Author:   jason_hays22
Date:     2012-05-31 17:22:52 +0000 (Thu, 31 May 2012)
Log Message:
-----------
This fixes a precision issue in multi-paint so that near zero values do not cause flickering as you paint.

It also changes multi-paint's "zero weight color" to black again--it was unintentionally changed to red some time late last year when an aspect of the colors were changed.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c

Modified: trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c	2012-05-31 16:59:25 UTC (rev 47286)
+++ trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c	2012-05-31 17:22:52 UTC (rev 47287)
@@ -1054,10 +1054,10 @@
 	}
 
 	if (make_black) { /* TODO, theme color */
-		r_col[3] = 0;
+		r_col[3] = 255;
 		r_col[2] = 0;
 		r_col[1] = 0;
-		r_col[0] = 255;
+		r_col[0] = 0;
 	}
 	else {
 		CLAMP(input, 0.0f, 1.0f);

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c	2012-05-31 16:59:25 UTC (rev 47286)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c	2012-05-31 17:22:52 UTC (rev 47287)
@@ -1878,6 +1878,7 @@
 		float oldw;
 		float neww;
 		float testw = 0;
+		float observedChange = 0;
 		float change = 0;
 		float oldChange = 0;
 		int i;
@@ -1889,13 +1890,14 @@
 		                    wpi->brush_alpha_value, wpi->do_flip, do_multipaint_totsel);
 		
 		/* setup multi-paint */
-		if (do_multipaint_totsel) {
+		observedChange = neww - oldw;
+		if (do_multipaint_totsel && observedChange) {
 			dv_copy.dw = MEM_dupallocN(dv->dw);
 			dv_copy.flag = dv->flag;
 			dv_copy.totweight = dv->totweight;
 			tdw = dw;
 			tdw_prev = dw_prev;
-			change = get_mp_change(&wp->wpaint_prev[index], wpi->defbase_tot, wpi->defbase_sel, neww - oldw);
+			change = get_mp_change(&wp->wpaint_prev[index], wpi->defbase_tot, wpi->defbase_sel, observedChange);
 			if (change) {
 				if (!tdw->weight) {
 					i = get_first_selected_nonzero_weight(dv, wpi->defbase_tot, wpi->defbase_sel);
@@ -1911,7 +1913,7 @@
 					if (tdw->weight != tdw_prev->weight) {
 						oldChange = tdw->weight / tdw_prev->weight;
 						testw = tdw_prev->weight * change;
-						if (testw > tdw_prev->weight) {
+						if (observedChange > 0) {
 							if (change > oldChange) {
 								/* reset the weights and use the new change */
 								defvert_reset_to_prev(wp->wpaint_prev + index, dv);




More information about the Bf-blender-cvs mailing list