[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37057] branches/soc-2011-onion/source/ blender/editors/sculpt_paint/paint_image.c: GSOC 2011 - onion branch

Ryakiotakis Antonis kalast at gmail.com
Tue May 31 22:29:45 CEST 2011


Revision: 37057
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37057
Author:   psy-fi
Date:     2011-05-31 20:29:44 +0000 (Tue, 31 May 2011)
Log Message:
-----------
GSOC 2011 - onion branch

-fix: smear brushes work again for float high-res images in projection paint mode.
There are the usual artifacts when using the space brush, to work better, use the airbrush mode.

Modified Paths:
--------------
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c

Modified: branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c	2011-05-31 19:32:48 UTC (rev 37056)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c	2011-05-31 20:29:44 UTC (rev 37057)
@@ -3658,13 +3658,14 @@
 {
 	unsigned char rgba_ub[4];
 	unsigned char rgba_smear[4];
+	float rgba[4];
 	
-	if (project_paint_PickColor(ps, co, NULL, rgba_ub, 1)==0)
+	if (project_paint_PickColor(ps, co, rgba, NULL, 1)==0)
 		return;
 	
-	IMAPAINT_FLOAT_RGBA_TO_CHAR(rgba_smear, projPixel->pixel.f_pt);
+	//IMAPAINT_FLOAT_RGBA_TO_CHAR(rgba_smear, projPixel->pixel.f_pt);
 	/* (ProjPixelClone *)projPixel)->clonepx.uint = IMB_blend_color(*((unsigned int *)rgba_smear), *((unsigned int *)rgba_ub), (int)(alpha*mask*255), ps->blend); */
-	blend_color_mix(((ProjPixelClone *)projPixel)->clonepx.ch, rgba_smear, (rgba_ub), (int)(alpha*mask*255)); 
+	blend_color_mix_float(((ProjPixelClone *)projPixel)->clonepx.f, projPixel->pixel.f_pt, rgba, alpha*mask); 
 	BLI_linklist_prepend_arena(smearPixels_f, (void *)projPixel, smearArena);
 }
 
@@ -3905,7 +3906,7 @@
 		
 		for (node= smearPixels_f; node; node= node->next) {
 			projPixel = node->link;
-			IMAPAINT_CHAR_RGBA_TO_FLOAT(projPixel->pixel.f_pt,  ((ProjPixelClone *)projPixel)->clonepx.ch);
+			copy_v4_v4(projPixel->pixel.f_pt, ((ProjPixelClone *)projPixel)->clonepx.f);
 		}
 		
 		BLI_memarena_free(smearArena);




More information about the Bf-blender-cvs mailing list