Commit: 1ea040281f8127710c6f5cdaf78827a13101a557
Author: JIANG Kairong
Date:   Sun Jun 19 04:39:49 2016 +0800
Branches: soc-2016-sculpt_tools
https://developer.blender.org/rB1ea040281f8127710c6f5cdaf78827a13101a557

first attempts to add silhouette brush

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

A       release/datafiles/brushicons/silhouette.png
M       release/datafiles/locale
M       release/scripts/addons
M       release/scripts/addons_contrib
M       source/blender/blenkernel/intern/brush.c
M       source/blender/editors/include/ED_datafiles.h
M       source/blender/editors/include/UI_icons.h
M       source/blender/editors/interface/interface_icons.c
M       source/blender/editors/sculpt_paint/sculpt.c
M       source/blender/makesdna/DNA_brush_types.h
M       source/blender/makesdna/DNA_scene_types.h
M       source/blender/makesrna/intern/rna_brush.c
M       source/blender/makesrna/intern/rna_sculpt_paint.c

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

diff --git a/release/datafiles/brushicons/silhouette.png 
b/release/datafiles/brushicons/silhouette.png
new file mode 100644
index 0000000..821ee8e
Binary files /dev/null and b/release/datafiles/brushicons/silhouette.png differ
diff --git a/release/datafiles/locale b/release/datafiles/locale
index 9628dc1..a87cfb8 160000
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 9628dc1922be2fb6281bc66f5f7512c2a57c294a
+Subproject commit a87cfb8a89e0c09f068418d62badf30bde40ee18
diff --git a/release/scripts/addons b/release/scripts/addons
index 407d0ea..75fb4e0 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 407d0ea752b3af73d3f13ba072671bd09eefecb1
+Subproject commit 75fb4e0a91d46bb8695579b6a780d2c9a9aef624
diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
index 9f29e18..72c24a1 160000
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@ -1 +1 @@
-Subproject commit 9f29e18707917ec5be262431d2e09dbb85332f41
+Subproject commit 72c24a1dbf158d4359cf1084981623edd4228282
diff --git a/source/blender/blenkernel/intern/brush.c 
b/source/blender/blenkernel/intern/brush.c
index 31dac03..f15aea1 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -140,7 +140,7 @@ void BKE_brush_init(Brush *brush)
 
        brush_defaults(brush);
 
-       brush->sculpt_tool = SCULPT_TOOL_DRAW; /* sculpting defaults to the 
draw tool for new brushes */
+    brush->sculpt_tool = SCULPT_TOOL_DRAW; /* sculpting defaults to the draw 
tool for new brushes */
 
        /* the default alpha falloff curve */
        BKE_brush_curve_preset(brush, CURVE_PRESET_SMOOTH);
diff --git a/source/blender/editors/include/ED_datafiles.h 
b/source/blender/editors/include/ED_datafiles.h
index 661ab58..4dd8ad6 100644
--- a/source/blender/editors/include/ED_datafiles.h
+++ b/source/blender/editors/include/ED_datafiles.h
@@ -165,6 +165,9 @@ extern char datatoc_twist_png[];
 extern int datatoc_vertexdraw_png_size;
 extern char datatoc_vertexdraw_png[];
 
+//extern int datatoc_silhouette_png_size;
+//extern char datatoc_silhouette_png[];
+
 /* Matcap files */
 
 extern int datatoc_mc01_jpg_size;
diff --git a/source/blender/editors/include/UI_icons.h 
b/source/blender/editors/include/UI_icons.h
index 2c80701..c0bf447 100644
--- a/source/blender/editors/include/UI_icons.h
+++ b/source/blender/editors/include/UI_icons.h
@@ -977,6 +977,7 @@ DEF_ICON(BRUSH_TEXMASK)
 DEF_ICON(BRUSH_THUMB)
 DEF_ICON(BRUSH_ROTATE)
 DEF_ICON(BRUSH_VERTEXDRAW)
+DEF_ICON(BRUSH_SILHOUETTE)
 
        /* Matcaps */
 DEF_ICON(MATCAP_01)
diff --git a/source/blender/editors/interface/interface_icons.c 
b/source/blender/editors/interface/interface_icons.c
index 0a25a8f..74e7857 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -598,7 +598,7 @@ static void init_brush_icons(void)
        INIT_BRUSH_ICON(ICON_BRUSH_SCULPT_DRAW, draw);
        INIT_BRUSH_ICON(ICON_BRUSH_FILL, fill);
        INIT_BRUSH_ICON(ICON_BRUSH_FLATTEN, flatten);
-       INIT_BRUSH_ICON(ICON_BRUSH_GRAB, grab);
+    INIT_BRUSH_ICON(ICON_BRUSH_GRAB, grab);
        INIT_BRUSH_ICON(ICON_BRUSH_INFLATE, inflate);
        INIT_BRUSH_ICON(ICON_BRUSH_LAYER, layer);
        INIT_BRUSH_ICON(ICON_BRUSH_LIGHTEN, lighten);
@@ -619,6 +619,7 @@ static void init_brush_icons(void)
        INIT_BRUSH_ICON(ICON_BRUSH_THUMB, thumb);
        INIT_BRUSH_ICON(ICON_BRUSH_ROTATE, twist);
        INIT_BRUSH_ICON(ICON_BRUSH_VERTEXDRAW, vertexdraw);
+    //INIT_BRUSH_ICON(ICON_BRUSH_SILHOUETTE, silhouette);
 
 #undef INIT_BRUSH_ICON
 }
diff --git a/source/blender/editors/sculpt_paint/sculpt.c 
b/source/blender/editors/sculpt_paint/sculpt.c
index c173156..f02b061 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -2214,7 +2214,7 @@ static void do_grab_brush_task_cb_ex(
                                               ss, brush, orig_data.co, 
test.dist, orig_data.no, NULL, vd.mask ? *vd.mask : 0.0f,
                                               thread_id);
 
-                       mul_v3_v3fl(proxy[vd.i], grab_delta, fade);
+            mul_v3_v3fl(proxy[vd.i], grab_delta, fade);
 
                        if (vd.mvert)
                                vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
@@ -3368,6 +3368,11 @@ static void sculpt_topology_update(Sculpt *sd, Object 
*ob, Brush *brush, Unified
        }
 }
 
+static void do_silhouette_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int 
totnode)
+{
+    /*TODO*/
+}
+
 static void do_brush_action_task_cb(void *userdata, const int n)
 {
        SculptThreadedTaskData *data = userdata;
@@ -3391,6 +3396,8 @@ static void do_brush_action(Sculpt *sd, Object *ob, Brush 
*brush, UnifiedPaintSe
        data.original = sculpt_tool_needs_original(brush->sculpt_tool) ? true : 
ss->cache->original;
        BKE_pbvh_search_gather(ss->pbvh, sculpt_search_sphere_cb, &data, 
&nodes, &totnode);
 
+    /*inlinebool: need a way to find area for silhouette brush specifically*/
+
        /* Only act if some verts are inside the brush area */
        if (totnode) {
                float location[3];
@@ -3465,6 +3472,9 @@ static void do_brush_action(Sculpt *sd, Object *ob, Brush 
*brush, UnifiedPaintSe
                        case SCULPT_TOOL_MASK:
                                do_mask_brush(sd, ob, nodes, totnode);
                                break;
+            /*should be called elsewhere, since the nodes are different from 
other brushes*/
+            case SCULPT_TOOL_SILHOUETTE:
+                do_silhouette_brush(sd, ob, nodes, totnode);
                }
 
                if (!ELEM(brush->sculpt_tool, SCULPT_TOOL_SMOOTH, 
SCULPT_TOOL_MASK) &&
@@ -3935,6 +3945,8 @@ static const char *sculpt_tool_name(Sculpt *sd)
                        return "Mask Brush";
                case SCULPT_TOOL_SIMPLIFY:
                        return "Simplify Brush";
+        case SCULPT_TOOL_SILHOUETTE:
+            return "Silhouette Brush";
        }
 
        return "Sculpting";
diff --git a/source/blender/makesdna/DNA_brush_types.h 
b/source/blender/makesdna/DNA_brush_types.h
index 3dca087..290a9f8 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -254,7 +254,8 @@ typedef enum BrushSculptTool {
        SCULPT_TOOL_CREASE = 16,
        SCULPT_TOOL_BLOB = 17,
        SCULPT_TOOL_CLAY_STRIPS = 18,
-       SCULPT_TOOL_MASK = 19
+    SCULPT_TOOL_MASK = 19,
+    SCULPT_TOOL_SILHOUETTE = 20
 } BrushSculptTool;
 
 /** When #BRUSH_ACCUMULATE is used */
diff --git a/source/blender/makesdna/DNA_scene_types.h 
b/source/blender/makesdna/DNA_scene_types.h
index 1bf044f..6876134 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -962,7 +962,7 @@ typedef struct TimeMarker {
 
 /* Paint Tool Base */
 typedef struct Paint {
-       struct Brush *brush;
+    struct Brush *brush;
        struct Palette *palette;
        struct CurveMapping *cavity_curve; /* cavity curve */
 
diff --git a/source/blender/makesrna/intern/rna_brush.c 
b/source/blender/makesrna/intern/rna_brush.c
index ac348c1..aa0ba19 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -70,7 +70,7 @@ EnumPropertyItem rna_enum_brush_sculpt_tool_items[] = {
        {SCULPT_TOOL_DRAW, "DRAW", ICON_BRUSH_SCULPT_DRAW, "Draw", ""},
        {SCULPT_TOOL_FILL, "FILL", ICON_BRUSH_FILL, "Fill", ""},
        {SCULPT_TOOL_FLATTEN, "FLATTEN", ICON_BRUSH_FLATTEN, "Flatten", ""},
-       {SCULPT_TOOL_GRAB, "GRAB", ICON_BRUSH_GRAB, "Grab", ""},
+    {SCULPT_TOOL_GRAB, "GRAB", ICON_BRUSH_GRAB, "Grab", ""},
        {SCULPT_TOOL_INFLATE, "INFLATE", ICON_BRUSH_INFLATE, "Inflate", ""},
        {SCULPT_TOOL_LAYER, "LAYER", ICON_BRUSH_LAYER, "Layer", ""},
        {SCULPT_TOOL_MASK, "MASK", ICON_BRUSH_MASK, "Mask", ""},
@@ -81,7 +81,8 @@ EnumPropertyItem rna_enum_brush_sculpt_tool_items[] = {
        {SCULPT_TOOL_SIMPLIFY, "SIMPLIFY", ICON_BRUSH_SUBTRACT /* icon TODO */, 
"Simplify", ""},
        {SCULPT_TOOL_SMOOTH, "SMOOTH", ICON_BRUSH_SMOOTH, "Smooth", ""},
        {SCULPT_TOOL_SNAKE_HOOK, "SNAKE_HOOK", ICON_BRUSH_SNAKE_HOOK, "Snake 
Hook", ""},
-       {SCULPT_TOOL_THUMB, "THUMB", ICON_BRUSH_THUMB, "Thumb", ""},
+    {SCULPT_TOOL_THUMB, "THUMB", ICON_BRUSH_THUMB, "Thumb", ""},
+    {SCULPT_TOOL_SILHOUETTE, "SILHOUETTE", ICON_BRUSH_GRAB /*icon TODO*/, 
"Silhouette", ""},
        {0, NULL, 0, NULL, NULL}
 };
 
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c 
b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 90215bc..7e86f18 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -63,7 +63,7 @@ static EnumPropertyItem particle_edit_hair_brush_items[] = {
 EnumPropertyItem rna_enum_gpencil_sculpt_brush_items[] = {
        {GP_EDITBRUSH_TYPE_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth stroke 
points"},
        {GP_EDITBRUSH_TYPE_THICKNESS, "THICKNESS", 0, "Thickness", "Adjust 
thickness of strokes"},
-       {GP_EDITBRUSH_TYPE_GRAB, "GRAB", 0, "Grab", "Translate the set of 
points initially within the brush circle"},
+    {GP_EDITBRUSH_TYPE_GRAB, "GRAB", 0, "Grab", "Translate the set of points 
initially within the brush circle"},
        {GP_EDITBRUSH_TYPE_PUSH, "PUSH", 0, "Push", "Move points out of the 
way, as if combing them"},
        {GP_EDITBRUSH_TYPE_TWIST, "TWIST", 0, "Twist", "Rotate points around 
the midpoint of the brush"},
        {GP_EDITBRUSH_TYPE_PINCH, "PINCH", 0, "Pinch", "Pull points towards the 
midpoint of the brush"},
@@ -418,7 +418,7 @@ static void rna_def_paint(BlenderRNA *brna)
        RNA_def_struct_ui_text(srna, "Paint", "");
 
        /* Global Settings */
-       prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
+    prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
        RNA_def_property_flag(prop, PROP_EDITABLE);
        RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, 
"rna_Brush_mode_poll");
        RNA_def_property_ui_text(prop, "Brush", "Active Brush");

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

Reply via email to