fix weird issue after last commit where grab brush would not work and
authorAntony Riakiotakis <kalast@gmail.com>
Sat, 14 Sep 2013 00:35:41 +0000 (00:35 +0000)
committerAntony Riakiotakis <kalast@gmail.com>
Sat, 14 Sep 2013 00:35:41 +0000 (00:35 +0000)
also warnings fix and description fix.

source/blender/blenkernel/intern/brush.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/makesrna/intern/rna_brush.c

index 0c79b8860d96505fcb1816909850e792441a6aa3..7864216f39e42f9a2365fb443d3ff5c3e1c790b2 100644 (file)
@@ -1051,5 +1051,5 @@ struct ImBuf *BKE_brush_gen_radial_control_imbuf(Brush *br, bool secondary)
 
 bool BKE_sculpt_brush_frontface_only(struct Brush *br)
 {
-       return br->sculpt_tool != SCULPT_TOOL_CLAY_STRIPS;
+       return br->sculpt_tool == SCULPT_TOOL_CLAY_STRIPS;
 }
index 03e5e6672bf9b03b98b0def6ae08a00644b3b0d9..a7d851d7a677c0007733d4f93b50465ff2ebf5b7 100644 (file)
@@ -951,7 +951,7 @@ static float tex_strength(SculptSession *ss, Brush *br,
                           const float fno[3],
                           const float mask)
 {
-       const StrokeCache *cache = ss->cache;
+       StrokeCache *cache = ss->cache;
        const Scene *scene = cache->vc->scene;
        MTex *mtex = &br->mtex;
        float avg = 1;
@@ -1289,13 +1289,13 @@ static void update_brush_local_mat(Sculpt *sd, Object *ob)
 
 /* Test whether the StrokeCache.sculpt_normal needs update in
  * do_brush_action() */
-static int brush_needs_sculpt_normal(const Brush *brush)
+static int brush_needs_sculpt_normal(const Brush *brush, SculptSession *ss)
 {
        return ((ELEM(brush->sculpt_tool,
                      SCULPT_TOOL_GRAB,
                      SCULPT_TOOL_SNAKE_HOOK) &&
                 ((brush->normal_weight > 0) ||
-                 (brush->flag & BRUSH_FRONTFACE))) ||
+                 ss->cache->frontface)) ||
 
                ELEM7(brush->sculpt_tool,
                      SCULPT_TOOL_BLOB,
@@ -3139,7 +3139,7 @@ static void do_brush_action(Sculpt *sd, Object *ob, Brush *brush)
                        BKE_pbvh_node_mark_update(nodes[n]);
                }
 
-               if (brush_needs_sculpt_normal(brush))
+               if (brush_needs_sculpt_normal(brush, ss))
                        update_sculpt_normal(sd, ob, nodes, totnode);
 
                if (brush->mtex.brush_map_mode == MTEX_MAP_MODE_AREA)
index 820a4605052d8113731b6c39a3bf4afc53986b48..78a1e7aa368cae2bf79b72af310d9badec9938f5 100644 (file)
@@ -240,7 +240,7 @@ static int rna_SculptToolCapabilities_has_strength_get(PointerRNA *ptr)
 static int rna_SculptToolCapabilities_has_frontface_get(PointerRNA *ptr)
 {
        Brush *br = (Brush *)ptr->data;
-       return BKE_sculpt_brush_frontface_only(br);
+       return !BKE_sculpt_brush_frontface_only(br);
 }
 
 static int rna_BrushCapabilities_has_texture_angle_get(PointerRNA *ptr)
@@ -562,7 +562,7 @@ static void rna_def_sculpt_capabilities(BlenderRNA *brna)
        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_frontface, "Has Strength");
+       SCULPT_TOOL_CAPABILITY(has_frontface, "Has Front Facing");
 
 #undef SCULPT_CAPABILITY
 }