Sculpting:
authorAntony Riakiotakis <kalast@gmail.com>
Fri, 3 Oct 2014 11:14:10 +0000 (13:14 +0200)
committerAntony Riakiotakis <kalast@gmail.com>
Fri, 3 Oct 2014 11:14:10 +0000 (13:14 +0200)
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.

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

index 1969572530db91480dfd0bba84c637b0d83c424b..ffd4299bc399778278529363449cd67efb72d97f 100644 (file)
@@ -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
index 661fe03912fae1b71f2c42f0a41cde9f95d85c45..105c83f986411ea396ca090b60442b4e3f4f517d 100644 (file)
@@ -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
index 22868035a13086302a3f3e6435f20edb1f3b4fe6..d8da0a12b502df8a945ced2ba42cbcb5c49d8328 100644 (file)
@@ -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;
index 7e518242b00bacabf8e35f0468a32f210a18213a..891130af7d833356e6c51a26bf0eb0e36d029760 100644 (file)
@@ -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;
index 1ff99271146b211651905eb6bc14d3c3342dc19c..bbc2e0572fa32c3bef4f7208e168f18cce44c13b 100644 (file)
@@ -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