[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33121] trunk/blender: Fix #22645: Texture paint: soften tool does draw brushes

Sergey Sharybin g.ulairi at gmail.com
Wed Nov 17 07:30:12 CET 2010


Revision: 33121
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33121
Author:   nazgul
Date:     2010-11-17 07:30:06 +0100 (Wed, 17 Nov 2010)

Log Message:
-----------
Fix #22645: Texture paint: soften tool does draw brushes

Disable projection painting for soften tools.

Also it looks like smear tools support projection in the code, so
enabled project paint menu for such tools

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/space_view3d_toolbar.py
    trunk/blender/source/blender/editors/sculpt_paint/paint_image.c

Modified: trunk/blender/release/scripts/ui/space_view3d_toolbar.py
===================================================================
--- trunk/blender/release/scripts/ui/space_view3d_toolbar.py	2010-11-17 05:28:25 UTC (rev 33120)
+++ trunk/blender/release/scripts/ui/space_view3d_toolbar.py	2010-11-17 06:30:06 UTC (rev 33121)
@@ -1159,7 +1159,7 @@
     @classmethod
     def poll(cls, context):
         brush = context.tool_settings.image_paint.brush
-        return (brush and brush.imagepaint_tool != 'SMEAR')
+        return (brush and brush.imagepaint_tool != 'SOFTEN')
 
     def draw_header(self, context):
         ipaint = context.tool_settings.image_paint

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_image.c	2010-11-17 05:28:25 UTC (rev 33120)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_image.c	2010-11-17 06:30:06 UTC (rev 33121)
@@ -4526,6 +4526,8 @@
 
 	ViewContext vc;
 	wmTimer *timer;
+
+	short restore_projection;
 } PaintOperation;
 
 static void paint_redraw(bContext *C, ImagePaintState *s, int final)
@@ -4611,6 +4613,13 @@
 	pop->first= 1;
 	op->customdata= pop;
 	
+	/* XXX: Soften tool does not support projection painting atm, so just disable
+	        projection for this brush */
+	if(brush->imagepaint_tool == PAINT_TOOL_SOFTEN) {
+		settings->imapaint.flag |= IMAGEPAINT_PROJECT_DISABLE;
+		pop->restore_projection = 1;
+	}
+
 	/* initialize from context */
 	if(CTX_wm_region_view3d(C)) {
 		pop->mode= PAINT_MODE_3D;
@@ -4731,6 +4740,9 @@
 	if(pop->timer)
 		WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), pop->timer);
 
+	if(pop->restore_projection)
+		settings->imapaint.flag &= ~IMAGEPAINT_PROJECT_DISABLE;
+
 	settings->imapaint.flag &= ~IMAGEPAINT_DRAWING;
 	imapaint_canvas_free(&pop->s);
 	brush_painter_free(pop->painter);





More information about the Bf-blender-cvs mailing list