[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58500] branches/soc-2013-paint/source/ blender: BRUSH_INVERTED is a temporary flag, do not store on DNA, move to unified

Antony Riakiotakis kalast at gmail.com
Mon Jul 22 16:39:15 CEST 2013


Revision: 58500
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58500
Author:   psy-fi
Date:     2013-07-22 14:39:15 +0000 (Mon, 22 Jul 2013)
Log Message:
-----------
BRUSH_INVERTED is a temporary flag, do not store on DNA, move to unified
paint settings instead. Note to self, unified paint settings are also
saved on DNA. To avoid that I should add a stroke cache. This can be
instantiated on startup, when random number generators for strokes are
instantiated.

Modified Paths:
--------------
    branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_cursor.c
    branches/soc-2013-paint/source/blender/editors/sculpt_paint/sculpt.c
    branches/soc-2013-paint/source/blender/makesdna/DNA_brush_types.h
    branches/soc-2013-paint/source/blender/makesdna/DNA_scene_types.h

Modified: branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_cursor.c
===================================================================
--- branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_cursor.c	2013-07-22 12:02:53 UTC (rev 58499)
+++ branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_cursor.c	2013-07-22 14:39:15 UTC (rev 58500)
@@ -817,7 +817,7 @@
 		/* check if brush is subtracting, use different color then */
 		/* TODO: no way currently to know state of pen flip or
 		 * invert key modifier without starting a stroke */
-		if ((!(brush->flag & BRUSH_INVERTED) ^
+		if ((!(ups->draw_inverted) ^
 		     !(brush->flag & BRUSH_DIR_IN)) &&
 		    ELEM5(brush->sculpt_tool, SCULPT_TOOL_DRAW,
 		          SCULPT_TOOL_INFLATE, SCULPT_TOOL_CLAY,

Modified: branches/soc-2013-paint/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- branches/soc-2013-paint/source/blender/editors/sculpt_paint/sculpt.c	2013-07-22 12:02:53 UTC (rev 58499)
+++ branches/soc-2013-paint/source/blender/editors/sculpt_paint/sculpt.c	2013-07-22 14:39:15 UTC (rev 58500)
@@ -3763,8 +3763,8 @@
 
 	/* not very nice, but with current events system implementation
 	 * we can't handle brush appearance inversion hotkey separately (sergey) */
-	if (cache->invert) brush->flag |= BRUSH_INVERTED;
-	else brush->flag &= ~BRUSH_INVERTED;
+	if (cache->invert) ups->draw_inverted = true;
+	else ups->draw_inverted = false;
 
 	/* Alt-Smooth */
 	if (cache->alt_smooth) {
@@ -4371,8 +4371,9 @@
 
 	/* Finished */
 	if (ss->cache) {
+		UnifiedPaintSettings *ups = &CTX_data_tool_settings(C)->unified_paint_settings;
 		Brush *brush = BKE_paint_brush(&sd->paint);
-		brush->flag &= ~BRUSH_INVERTED;
+		ups->draw_inverted = false;
 
 		sculpt_stroke_modifiers_check(C, ob);
 

Modified: branches/soc-2013-paint/source/blender/makesdna/DNA_brush_types.h
===================================================================
--- branches/soc-2013-paint/source/blender/makesdna/DNA_brush_types.h	2013-07-22 12:02:53 UTC (rev 58499)
+++ branches/soc-2013-paint/source/blender/makesdna/DNA_brush_types.h	2013-07-22 14:39:15 UTC (rev 58500)
@@ -171,10 +171,7 @@
 	BRUSH_PLANE_TRIM = (1 << 26),
 	BRUSH_FRONTFACE = (1 << 27),
 	BRUSH_CUSTOM_ICON = (1 << 28),
-
-	/* temporary flag which sets up automatically for correct brush
-	 * drawing when inverted modal operator is running */
-	BRUSH_INVERTED = (1 << 29),
+	//BRUSH_INVERTED = (1 << 29), /* Unused now, free for something new */
 	BRUSH_ABSOLUTE_JITTER = (1 << 30)
 } BrushFlags;
 

Modified: branches/soc-2013-paint/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- branches/soc-2013-paint/source/blender/makesdna/DNA_scene_types.h	2013-07-22 12:02:53 UTC (rev 58499)
+++ branches/soc-2013-paint/source/blender/makesdna/DNA_scene_types.h	2013-07-22 14:39:15 UTC (rev 58500)
@@ -906,7 +906,11 @@
 	/* all this below is used as a cache to communicate with the cursor drawing routine
 	 * and texture sampling functions. Probably a better place should be used than this */
 	int draw_anchored;
-	int   anchored_size;
+	int anchored_size;
+
+	int draw_inverted;
+	int pad;
+
 	float overlap_factor; /* normalization factor due to accumulated value of curve along spacing.
 	                       * Calculated when brush spacing changes to dampen strength of stroke
 	                       * if space attenuation is used*/




More information about the Bf-blender-cvs mailing list