[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60337] branches/soc-2013-paint: Tidying options, line based strokes do not support stroke smoothing
Antony Riakiotakis
kalast at gmail.com
Mon Sep 23 17:47:53 CEST 2013
Revision: 60337
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60337
Author: psy-fi
Date: 2013-09-23 15:47:53 +0000 (Mon, 23 Sep 2013)
Log Message:
-----------
Tidying options, line based strokes do not support stroke smoothing
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/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 15:34:45 UTC (rev 60336)
+++ branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py 2013-09-23 15:47:53 UTC (rev 60337)
@@ -915,14 +915,15 @@
col = layout.column()
col.separator()
- col.prop(brush, "use_smooth_stroke")
+ if brush.brush_capabilities.has_smooth_stroke:
+ col.prop(brush, "use_smooth_stroke")
- sub = col.column()
- sub.active = brush.use_smooth_stroke
- sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
- sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
+ sub = col.column()
+ sub.active = brush.use_smooth_stroke
+ sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
+ sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
- col.separator()
+ col.separator()
row = col.row(align=True)
if brush.use_relative_jitter:
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 15:34:45 UTC (rev 60336)
+++ branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py 2013-09-23 15:47:53 UTC (rev 60337)
@@ -1004,12 +1004,13 @@
col = layout.column()
col.separator()
- col.prop(brush, "use_smooth_stroke")
+ if brush.brush_capabilities.has_smooth_stroke:
+ col.prop(brush, "use_smooth_stroke")
- sub = col.column()
- sub.active = brush.use_smooth_stroke
- sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
- sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
+ sub = col.column()
+ sub.active = brush.use_smooth_stroke
+ sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
+ sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
layout.prop(settings, "input_samples")
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 15:34:45 UTC (rev 60336)
+++ branches/soc-2013-paint/source/blender/makesrna/intern/rna_brush.c 2013-09-23 15:47:53 UTC (rev 60337)
@@ -222,6 +222,17 @@
SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB));
}
+static int rna_BrushCapabilities_has_smooth_stroke_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush *)ptr->data;
+ return (!(br->flag & BRUSH_ANCHORED) &&
+ !(br->flag & BRUSH_DRAG_DOT) &&
+ !(br->flag & BRUSH_LINE) &&
+ !(br->flag & BRUSH_POLYLINE) &&
+ !(br->flag & BRUSH_CURVE)
+ );
+}
+
static int rna_SculptToolCapabilities_has_space_attenuation_get(PointerRNA *ptr)
{
Brush *br = (Brush *)ptr->data;
@@ -660,7 +671,9 @@
BRUSH_CAPABILITY(has_texture_angle, "Has Texture Angle");
BRUSH_CAPABILITY(has_texture_angle_source, "Has Texture Angle Source");
BRUSH_CAPABILITY(has_spacing, "Has Spacing");
+ BRUSH_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke");
+
#undef BRUSH_CAPABILITY
}
More information about the Bf-blender-cvs
mailing list