[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60339] branches/soc-2013-paint: More UI cleanup for the fill tool, it doesn't support accumulation or
Antony Riakiotakis
kalast at gmail.com
Mon Sep 23 18:33:39 CEST 2013
Revision: 60339
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60339
Author: psy-fi
Date: 2013-09-23 16:33:39 +0000 (Mon, 23 Sep 2013)
Log Message:
-----------
More UI cleanup for the fill tool, it doesn't support accumulation or
size.
Fix accumulation flag UI not appearing
Modified Paths:
--------------
branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py
branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py
branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image.c
branches/soc-2013-paint/source/blender/makesrna/intern/rna_brush.c
Modified: branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py 2013-09-23 16:11:26 UTC (rev 60338)
+++ branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py 2013-09-23 16:33:39 UTC (rev 60339)
@@ -747,25 +747,20 @@
col.prop(brush, "secondary_color", text="")
col.operator("paint.brush_colors_flip", icon='FILE_REFRESH')
- col.prop(brush, "blend", text="Blend")
-
col = layout.column()
col.template_ID(toolsettings, "palette", new="palette.new")
if toolsettings.palette:
- col.template_palette(toolsettings, "palette", color=True)
+ col.template_palette(toolsettings, "palette", color=True)
+
+ col.prop(brush, "blend", text="Blend")
- row = col.row(align=True)
- self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
- self.prop_unified_size(row, context, brush, "use_pressure_size")
+ col = layout.column()
- row = col.row(align=True)
-
- if capabilities.has_space_attenuation:
- if brush.use_space_attenuation:
- row.prop(brush, "use_space_attenuation", toggle=True, text="", icon='LOCKED')
- else:
- row.prop(brush, "use_space_attenuation", toggle=True, text="", icon='UNLOCKED')
-
+ if capabilities.has_radius:
+ row = col.row(align=True)
+ self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
+ self.prop_unified_size(row, context, brush, "use_pressure_size")
+
if brush.image_tool == 'SOFTEN':
col = layout.column(align=True)
col.row().prop(brush, "direction", expand=True)
@@ -780,17 +775,25 @@
col.prop(brush, "clone_image", text="Image")
col.prop(brush, "clone_alpha", text="Alpha")
+ row = col.row(align=True)
+
+ if capabilities.has_space_attenuation:
+ if brush.use_space_attenuation:
+ row.prop(brush, "use_space_attenuation", toggle=True, text="", icon='LOCKED')
+ else:
+ row.prop(brush, "use_space_attenuation", toggle=True, text="", icon='UNLOCKED')
+
+ self.prop_unified_strength(row, context, brush, "strength", slider=True, text="Strength")
+ self.prop_unified_strength(row, context, brush, "use_pressure_strength")
+
# use_accumulate
if capabilities.has_accumulate:
col.separator()
col.prop(brush, "use_accumulate")
- self.prop_unified_strength(row, context, brush, "strength", slider=True, text="Strength")
- self.prop_unified_strength(row, context, brush, "use_pressure_strength")
-
class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel):
bl_label = "Texture"
bl_options = {'DEFAULT_CLOSED'}
Modified: branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py 2013-09-23 16:11:26 UTC (rev 60338)
+++ branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py 2013-09-23 16:33:39 UTC (rev 60339)
@@ -765,17 +765,11 @@
col.prop(brush, "blend", text="Blend")
col = layout.column()
- row = col.row(align=True)
- self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
- self.prop_unified_size(row, context, brush, "use_pressure_size")
-
- row = col.row(align=True)
- if capabilities.has_space_attenuation:
- if brush.use_space_attenuation:
- row.prop(brush, "use_space_attenuation", toggle=True, text="", icon='LOCKED')
- else:
- row.prop(brush, "use_space_attenuation", toggle=True, text="", icon='UNLOCKED')
+ if capabilities.has_radius:
+ row = col.row(align=True)
+ self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
+ self.prop_unified_size(row, context, brush, "use_pressure_size")
if brush.image_tool == 'SOFTEN':
col = layout.column(align=True)
@@ -786,14 +780,22 @@
col.separator()
col.prop(brush, "blur_mode")
+ row = col.row(align=True)
+
+ if capabilities.has_space_attenuation:
+ if brush.use_space_attenuation:
+ row.prop(brush, "use_space_attenuation", toggle=True, text="", icon='LOCKED')
+ else:
+ row.prop(brush, "use_space_attenuation", toggle=True, text="", icon='UNLOCKED')
+
+ self.prop_unified_strength(row, context, brush, "strength", text="Strength")
+ self.prop_unified_strength(row, context, brush, "use_pressure_strength")
+
# use_accumulate
if capabilities.has_accumulate:
- col.separator()
+ col = layout.column(align=True)
col.prop(brush, "use_accumulate")
- self.prop_unified_strength(row, context, brush, "strength", text="Strength")
- self.prop_unified_strength(row, context, brush, "use_pressure_strength")
-
# Weight Paint Mode #
elif context.weight_paint_object and brush:
Modified: branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image.c 2013-09-23 16:11:26 UTC (rev 60338)
+++ branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image.c 2013-09-23 16:33:39 UTC (rev 60339)
@@ -627,6 +627,7 @@
(brush->flag & BRUSH_ANCHORED) ||
(brush->imagepaint_tool == PAINT_TOOL_SMEAR) ||
(brush->imagepaint_tool == PAINT_TOOL_SOFTEN) ||
+ (brush->imagepaint_tool == PAINT_TOOL_FILL) ||
(brush->flag & BRUSH_USE_GRADIENT) ||
(brush->mtex.tex && !ELEM3(brush->mtex.brush_map_mode, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_3D)) ||
brush->flag & BRUSH_ACCUMULATE) ?
Modified: branches/soc-2013-paint/source/blender/makesrna/intern/rna_brush.c
===================================================================
--- branches/soc-2013-paint/source/blender/makesrna/intern/rna_brush.c 2013-09-23 16:11:26 UTC (rev 60338)
+++ branches/soc-2013-paint/source/blender/makesrna/intern/rna_brush.c 2013-09-23 16:33:39 UTC (rev 60339)
@@ -244,7 +244,8 @@
static int rna_ImapaintToolCapabilities_has_space_attenuation_get(PointerRNA *ptr)
{
Brush *br = (Brush *)ptr->data;
- return ((br->flag & (BRUSH_SPACE | BRUSH_LINE | BRUSH_POLYLINE | BRUSH_CURVE)) && (br->flag & BRUSH_ACCUMULATE));
+ return (br->flag & (BRUSH_SPACE | BRUSH_LINE | BRUSH_POLYLINE | BRUSH_CURVE)) &&
+ br->imagepaint_tool != PAINT_TOOL_FILL;
}
static int rna_BrushCapabilities_has_spacing_get(PointerRNA *ptr)
@@ -295,11 +296,20 @@
(br->flag & BRUSH_ANCHORED) ||
(br->imagepaint_tool == PAINT_TOOL_SOFTEN) ||
(br->imagepaint_tool == PAINT_TOOL_SMEAR) ||
+ (br->imagepaint_tool == PAINT_TOOL_FILL) ||
(br->mtex.tex && !ELEM3(br->mtex.brush_map_mode, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_3D))
) ? false : true;
}
+static int rna_ImapaintToolCapabilities_has_radius_get(PointerRNA *ptr)
+{
+ /* only support for draw tool */
+ Brush *br = (Brush *)ptr->data;
+ return (br->imagepaint_tool != PAINT_TOOL_FILL);
+}
+
+
static PointerRNA rna_Sculpt_tool_capabilities_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_SculptToolCapabilities, ptr->id.data);
@@ -699,6 +709,7 @@
IMAPAINT_TOOL_CAPABILITY(has_accumulate, "Has Accumulate");
IMAPAINT_TOOL_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
+ IMAPAINT_TOOL_CAPABILITY(has_radius, "Has Radius");
#undef IMAPAINT_TOOL_CAPABILITY
}
More information about the Bf-blender-cvs
mailing list