[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48208] branches/soc-2012-bratwurst: Looks like there has already been a setting for preserving the brush

Antony Riakiotakis kalast at gmail.com
Fri Jun 22 20:44:12 CEST 2012


Revision: 48208
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48208
Author:   psy-fi
Date:     2012-06-22 18:44:08 +0000 (Fri, 22 Jun 2012)
Log Message:
-----------
Looks like there has already been a setting for preserving the brush
size. I will use that instead for radius sync. In Sculpt mode it uses
projection to mesh to make things work. Doing collision detection on
other modes may not be practical due to lack of acceleration routinces.

Modified Paths:
--------------
    branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d_toolbar.py
    branches/soc-2012-bratwurst/source/blender/editors/space_view3d/view3d_edit.c
    branches/soc-2012-bratwurst/source/blender/makesdna/DNA_brush_types.h
    branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_brush.c

Modified: branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2012-06-22 18:19:30 UTC (rev 48207)
+++ branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2012-06-22 18:44:08 UTC (rev 48208)
@@ -496,9 +496,6 @@
                 if tool != 'ADD':
                     col.prop(brush, "strength", slider=True)
 
-                row = col.row(align=True)
-                col.prop(brush, "radius_sync")
-
             if tool == 'ADD':
                 col.prop(brush, "count")
                 col = layout.column()
@@ -634,9 +631,6 @@
                     col.prop(brush, "use_persistent")
                     col.operator("sculpt.set_persistent_base")
 
-            row = col.row(align=True)
-            col.prop(brush, "")
-
         # Texture Paint Mode #
 
         elif context.image_paint_object and brush:
@@ -645,6 +639,7 @@
             col.prop(brush, "color", text="")
 
             row = col.row(align=True)
+            self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
             self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
             self.prop_unified_size(row, context, brush, "use_pressure_size")
 
@@ -664,7 +659,6 @@
             col = layout.column()
             col.active = (brush.blend not in {'ERASE_ALPHA', 'ADD_ALPHA'})
             col.prop(brush, "use_alpha")
-            col.prop(brush, "radius_sync")
 
         # Weight Paint Mode #
         elif context.weight_paint_object and brush:
@@ -677,6 +671,7 @@
             self.prop_unified_weight(row, context, brush, "weight", slider=True, text="Weight")
 
             row = col.row(align=True)
+            self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
             self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
             self.prop_unified_size(row, context, brush, "use_pressure_size")
 
@@ -688,9 +683,6 @@
             row.prop(brush, "jitter", slider=True)
             row.prop(brush, "use_pressure_jitter", toggle=True, text="")
 
-            row = col.row(align=True)
-            col.prop(brush, "radius_sync")
-
         # Vertex Paint Mode #
         elif context.vertex_paint_object and brush:
             col = layout.column()
@@ -698,6 +690,7 @@
             col.prop(brush, "color", text="")
 
             row = col.row(align=True)
+            self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
             self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
             self.prop_unified_size(row, context, brush, "use_pressure_size")
 
@@ -710,10 +703,7 @@
             #row.prop(brush, "jitter", slider=True)
             #row.prop(brush, "use_pressure_jitter", toggle=True, text="")
 
-            row = col.row(align=True)
-            col.prop(brush, "radius_sync")
 
-
 class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
     bl_label = "Texture"
     bl_options = {'DEFAULT_CLOSED'}

Modified: branches/soc-2012-bratwurst/source/blender/editors/space_view3d/view3d_edit.c
===================================================================
--- branches/soc-2012-bratwurst/source/blender/editors/space_view3d/view3d_edit.c	2012-06-22 18:19:30 UTC (rev 48207)
+++ branches/soc-2012-bratwurst/source/blender/editors/space_view3d/view3d_edit.c	2012-06-22 18:44:08 UTC (rev 48208)
@@ -1458,7 +1458,7 @@
 	Paint *p = paint_get_active(scene);
 	Brush *brush = paint_brush(p);
 
-	if (brush && (brush->flag & BRUSH_RADIUS_SYNC))
+	if (brush && BKE_brush_use_locked_size(scene, brush))
 	{
 		int oldsize = BKE_brush_size_get(scene, brush);
 		int newsize = oldsize*factor + 0.5;

Modified: branches/soc-2012-bratwurst/source/blender/makesdna/DNA_brush_types.h
===================================================================
--- branches/soc-2012-bratwurst/source/blender/makesdna/DNA_brush_types.h	2012-06-22 18:19:30 UTC (rev 48207)
+++ branches/soc-2012-bratwurst/source/blender/makesdna/DNA_brush_types.h	2012-06-22 18:44:08 UTC (rev 48208)
@@ -141,8 +141,7 @@
 
 	/* temporary flag which sets up automatically for correct brush
 	 * drawing when inverted modal operator is running */
-	BRUSH_INVERTED = (1 << 29),
-	BRUSH_RADIUS_SYNC = (1 << 30)
+	BRUSH_INVERTED = (1 << 29)
 } BrushFlags;
 
 /* Brush.sculpt_tool */

Modified: branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_brush.c
===================================================================
--- branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_brush.c	2012-06-22 18:19:30 UTC (rev 48207)
+++ branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_brush.c	2012-06-22 18:44:08 UTC (rev 48208)
@@ -832,11 +832,6 @@
 	                         "Automatically adjust strength to give consistent results for different spacings");
 	RNA_def_property_update(prop, 0, "rna_Brush_update");
 
-	prop = RNA_def_property(srna, "radius_sync", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RADIUS_SYNC);
-	RNA_def_property_ui_text(prop, "Radius Sync", "Resize the brush when zooming");
-	RNA_def_property_update(prop, 0, "rna_Brush_update");
-
 	/* adaptive space is not implemented yet */
 	prop = RNA_def_property(srna, "use_adaptive_space", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ADAPTIVE_SPACE);




More information about the Bf-blender-cvs mailing list