Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2012-05-15 08:50:47 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2012-05-15 08:50:47 +0400
commita8e9d5533f51455febc40d386c8c2ce0cc561b7a (patch)
tree6c111b7755a52f0a043a7be285abc5752627f34b /source/blender/makesrna/intern/rna_brush.c
parentcb24a9505a42b286d3feb1638c8d190f09ad2cd7 (diff)
Code/UI cleanup: improvements for sculpt brush texture settings.
Settings are shown in both the View3D toolbar and texture properties panel; code is now in shared sculpt_brush_texture_settings() function in properties_paint_common.py. Also added a few new properties to the SculptCapabilities RNA to replace "X in {Y, Z}" tests in the Python code.
Diffstat (limited to 'source/blender/makesrna/intern/rna_brush.c')
-rw-r--r--source/blender/makesrna/intern/rna_brush.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index e585e58f982..0a8c241f5ee 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -142,6 +142,14 @@ static int rna_SculptCapabilities_has_normal_weight_get(PointerRNA *ptr)
return ELEM(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK);
}
+static int rna_SculptCapabilities_has_overlay_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush *)ptr->data;
+ return ELEM(br->mtex.brush_map_mode,
+ MTEX_MAP_MODE_VIEW,
+ MTEX_MAP_MODE_TILED);
+}
+
static int rna_SculptCapabilities_has_persistence_get(PointerRNA *ptr)
{
Brush *br = (Brush *)ptr->data;
@@ -222,6 +230,20 @@ static int rna_SculptCapabilities_has_strength_get(PointerRNA *ptr)
return !ELEM(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK);
}
+static int rna_SculptCapabilities_has_texture_angle_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush *)ptr->data;
+ return ELEM(br->mtex.brush_map_mode,
+ MTEX_MAP_MODE_VIEW,
+ MTEX_MAP_MODE_TILED);
+}
+
+static int rna_SculptCapabilities_has_texture_angle_source_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush *)ptr->data;
+ return br->mtex.brush_map_mode == MTEX_MAP_MODE_VIEW;
+}
+
static PointerRNA rna_Brush_sculpt_capabilities_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_SculptCapabilities, ptr->id.data);
@@ -441,6 +463,7 @@ static void rna_def_sculpt_capabilities(BlenderRNA *brna)
BRUSH_CAPABILITY(has_height, "Has Height");
BRUSH_CAPABILITY(has_jitter, "Has Jitter");
BRUSH_CAPABILITY(has_normal_weight, "Has Crease/Pinch Factor");
+ BRUSH_CAPABILITY(has_overlay, "Has Overlay");
BRUSH_CAPABILITY(has_persistence, "Has Persistence");
BRUSH_CAPABILITY(has_pinch_factor, "Has Pinch Factor");
BRUSH_CAPABILITY(has_plane_offset, "Has Plane Offset");
@@ -451,6 +474,8 @@ static void rna_def_sculpt_capabilities(BlenderRNA *brna)
BRUSH_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
BRUSH_CAPABILITY(has_spacing, "Has Spacing");
BRUSH_CAPABILITY(has_strength, "Has Strength");
+ BRUSH_CAPABILITY(has_texture_angle, "Has Texture Angle");
+ BRUSH_CAPABILITY(has_texture_angle_source, "Has Texture Angle Source");
#undef SCULPT_CAPABILITY
}