Commit: 72f557d34e21a5fe341de0a88797334810a3c66c
Author: Antony Riakiotakis
Date:   Fri Oct 3 13:14:10 2014 +0200
Branches: master
https://developer.blender.org/rB72f557d34e21a5fe341de0a88797334810a3c66c

Sculpting:

Grab and Snake hook brushes now support strength. To keep compatibility
with older brushes, this commit also sets strength to 1.0 for those
brushes.

===================================================================

M       release/scripts/startup/bl_ui/space_view3d_toolbar.py
M       source/blender/blenkernel/BKE_blender.h
M       source/blender/blenloader/intern/versioning_270.c
M       source/blender/editors/sculpt_paint/sculpt.c
M       source/blender/makesrna/intern/rna_brush.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 1969572..ffd4299 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -844,14 +844,15 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
             self.prop_unified_size(row, context, brush, "use_pressure_size")
 
             # strength, use_strength_pressure, and use_strength_attenuation
-            if capabilities.has_strength:
-                col.separator()
-                row = col.row(align=True)
+            col.separator()
+            row = col.row(align=True)
+
+            if capabilities.has_space_attenuation:
+                row.prop(brush, "use_space_attenuation", toggle=True, 
icon_only=True)
 
-                if capabilities.has_space_attenuation:
-                    row.prop(brush, "use_space_attenuation", toggle=True, 
icon_only=True)
+            self.prop_unified_strength(row, context, brush, "strength", 
text="Strength")
 
-                self.prop_unified_strength(row, context, brush, "strength", 
text="Strength")
+            if capabilities.has_strength_pressure:
                 self.prop_unified_strength(row, context, brush, 
"use_pressure_strength")
 
             # auto_smooth_factor and use_inverse_smooth_pressure
diff --git a/source/blender/blenkernel/BKE_blender.h 
b/source/blender/blenkernel/BKE_blender.h
index 661fe03..105c83f 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -42,7 +42,7 @@ extern "C" {
  * and keep comment above the defines.
  * Use STRINGIFY() rather than defining with quotes */
 #define BLENDER_VERSION         272
-#define BLENDER_SUBVERSION      0
+#define BLENDER_SUBVERSION      1
 /* 262 was the last editmesh release but it has compatibility code for bmesh 
data */
 #define BLENDER_MINVERSION      270
 #define BLENDER_MINSUBVERSION   5
diff --git a/source/blender/blenloader/intern/versioning_270.c 
b/source/blender/blenloader/intern/versioning_270.c
index 2286803..d8da0a1 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -390,6 +390,14 @@ void blo_do_versions_270(FileData *fd, Library 
*UNUSED(lib), Main *main)
                        }
                }
        }
+       
+       if (!MAIN_VERSION_ATLEAST(main, 272, 1)) {
+               Brush *br;
+               for (br = main->brush.first; br; br = br->id.next) {
+                       if ((br->ob_mode & OB_MODE_SCULPT) && 
ELEM(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK))
+                               br->alpha = 1.0f;
+               }
+       }
 
        if (!DNA_struct_elem_find(fd->filesdna, "Image", "float", "gen_color")) 
{
                Image *image;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c 
b/source/blender/editors/sculpt_paint/sculpt.c
index 7e51824..891130a 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -809,10 +809,10 @@ static float brush_strength(Sculpt *sd, StrokeCache 
*cache, float feather, Unifi
                        return alpha * pressure * feather;
 
                case SCULPT_TOOL_SNAKE_HOOK:
-                       return feather;
+                       return root_alpha * feather;
 
                case SCULPT_TOOL_GRAB:
-                       return feather;
+                       return root_alpha * feather;
 
                case SCULPT_TOOL_ROTATE:
                        return alpha * pressure * feather;
diff --git a/source/blender/makesrna/intern/rna_brush.c 
b/source/blender/makesrna/intern/rna_brush.c
index 1ff9927..bbc2e05 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -264,7 +264,7 @@ static int rna_BrushCapabilities_has_spacing_get(PointerRNA 
*ptr)
        return (!(br->flag & BRUSH_ANCHORED));
 }
 
-static int rna_SculptToolCapabilities_has_strength_get(PointerRNA *ptr)
+static int rna_SculptToolCapabilities_has_strength_pressure_get(PointerRNA 
*ptr)
 {
        Brush *br = (Brush *)ptr->data;
        return !ELEM(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK);
@@ -689,7 +689,7 @@ static void rna_def_sculpt_capabilities(BlenderRNA *brna)
        SCULPT_TOOL_CAPABILITY(has_secondary_color, "Has Secondary Color");
        SCULPT_TOOL_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke");
        SCULPT_TOOL_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
-       SCULPT_TOOL_CAPABILITY(has_strength, "Has Strength");
+       SCULPT_TOOL_CAPABILITY(has_strength_pressure, "Has Strength Pressure");
        SCULPT_TOOL_CAPABILITY(has_gravity, "Has Gravity");
 
 #undef SCULPT_CAPABILITY

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to