Small cleanup. Cleared every unconnected changes and fixed some minor ui bugs.
authorwitt <sebastian.witt@rwth-aachen.de>
Thu, 1 Jun 2017 09:10:03 +0000 (11:10 +0200)
committerwitt <sebastian.witt@rwth-aachen.de>
Thu, 1 Jun 2017 09:10:03 +0000 (11:10 +0200)
release/scripts/startup/bl_ui/space_view3d_toolbar.py
source/blender/blenkernel/intern/brush.c
source/blender/blenloader/intern/versioning_270.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sculpt_paint/sculpt_intern.h
source/blender/editors/sculpt_paint/sculpt_undo.c
source/blender/makesdna/DNA_brush_types.h
source/blender/makesrna/intern/rna_brush.c

index 7701ea712cb252c10629d549e542797432fc5695..8d375ec861c8f3c76061d91e203f1b88e5356714 100644 (file)
@@ -1032,7 +1032,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
                 row = col.row(align=True)
                 row.prop(brush, "rake_factor", slider=True)
 
-            # use_original_normal and sculpt_plane and sculpt_plane_range
+            # use_original_normal and sculpt_plane
             if capabilities.has_sculpt_plane:
                 col.separator()
                 row = col.row(align=True)
@@ -1041,9 +1041,6 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
 
                 row.prop(brush, "sculpt_plane", text="")
 
-                row = col.row()
-                row.prop(brush, "sculpt_plane_range")
-
             if brush.sculpt_tool == 'MASK':
                 col.prop(brush, "mask_tool", text="")
 
@@ -1448,11 +1445,6 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
             col.separator()
             col.prop(brush, "use_adaptive_space", text="Adaptive Spacing")
 
-        if brush.use_line or brush.use_curve:
-            col.separator()
-            row = col.row(align=True)
-            row.prop(brush, "spacing", text="Spacing")
-
         if brush.use_curve:
             col.separator()
             col.template_ID(brush, "paint_curve", new="paintcurve.new")
index 80aa8efa0a9eac060ddc893e95d9e2e38f0709e8..1a9295d579e3accb86411b09998e2a8c99b103f4 100644 (file)
@@ -78,8 +78,7 @@ static void brush_defaults(Brush *brush)
        brush->alpha = 0.5f; /* brush strength/intensity probably variable should be renamed? */
        brush->autosmooth_factor = 0.0f;
        brush->crease_pinch_factor = 0.5f;
-       brush->sculpt_plane = SCULPT_DISP_DIR_AREA; /* default to the area normal as the sculpt plane displacement direction */
-       brush->sculpt_plane_range= 1; /* how large an area to determine the normal of the plane in brush radiuses */
+       brush->sculpt_plane = SCULPT_DISP_DIR_AREA;
        brush->plane_offset = 0.0f; /* how far above or below the plane that is found by averaging the faces */
        brush->plane_trim = 0.5f;
        brush->clone.alpha = 0.5f;
index 09ba7f238091c638332bc30f305a5582af693b0d..d3260db1477e4c82b723aa91510194060c8d7e4c 100644 (file)
@@ -1575,16 +1575,6 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
                        }
                }
 
-               Brush *br;
-               for (br = main->brush.first; br; br = br->id.next) {
-                       br->flag |= BRUSH_SPACE_ATTEN; // enable adaptive attenuation
-                       //TODO currently too slow to be enabled on by default
-                       //br->flag |= BRUSH_ADAPTIVE_SPACE;
-                       if (br->ob_mode & OB_MODE_SCULPT)
-                               br->sculpt_plane_range = 1.0;                           
-               }
-
-
                /* Fix for T50736, Glare comp node using same var for two different things. */
                if (!DNA_struct_elem_find(fd->filesdna, "NodeGlare", "char", "star_45")) {
                        FOREACH_NODETREE(main, ntree, id) {
index d6dd6be0d7512bf4f7137fe36aaada3efc68a796..158ada1a2ea95fd54582a7beea26a142c001f6fb 100644 (file)
@@ -640,13 +640,11 @@ static float paint_stroke_integrate_overlap(Brush *br, float factor)
 
 static float paint_space_stroke_spacing_variable(const Scene *scene, PaintStroke *stroke, float pressure, float dpressure, float length)
 {
-       float spacing = paint_space_unadjusted_stroke_spacing(scene, stroke); //spacing without adjustment for angle or pressure
+       float spacing = paint_space_unadjusted_stroke_spacing(scene, stroke);
 
-       //adapt the stroke spacing to account for geometry that curves away from the viewport
        if (BKE_brush_use_adaptive_spacing(stroke->brush)) {
+               /*adapt the stroke spacing to account for geometry that curves away from the viewport*/
                spacing = paint_space_stroke_adaptive_spacing(scene, stroke, spacing);
-               //TODO perhaps should do a last_adaptive and new_adaptive as is done with pressure
-
        }
 
        if (BKE_brush_use_size_pressure(scene, stroke->brush)) {
index a4cf9800b80858706b4f81f1cac0b072b5713e3c..e59b144836e9b47e1e0ecf266c5fe1ad13fcc305 100644 (file)
@@ -693,24 +693,6 @@ static void sculpt_brush_test_init(SculptSession *ss, SculptBrushTest *test)
        }
 }
 
-static void sculpt_brush_range_test_init(const SculptSession *ss, SculptBrushTest *test, float range)
-{
-       RegionView3D *rv3d = ss->cache->vc->rv3d;
-
-       test->radius_squared= ss->cache->radius_squared*range*range;
-       copy_v3_v3(test->location, ss->cache->location);
-       test->dist = 0.0f;   /* just for initialize */
-
-       test->mirror_symmetry_pass = ss->cache->mirror_symmetry_pass;
-
-       if (rv3d->rflag & RV3D_CLIPPING) {
-               test->clip_rv3d = rv3d;
-       }
-       else {
-               test->clip_rv3d = NULL;
-       }
-}
-
 BLI_INLINE bool sculpt_brush_test_clipping(const SculptBrushTest *test, const float co[3])
 {
        RegionView3D *rv3d = test->clip_rv3d;
@@ -927,7 +909,6 @@ static void calc_area_normal_and_center_task_cb(void *userdata, const int n)
        SculptSession *ss = data->ob->sculpt;
        float (*area_nos)[3] = data->area_nos;
        float (*area_cos)[3] = data->area_cos;
-       float sampling_radius_pct = data->brush->sculpt_plane_range;
 
        PBVHVertexIter vd;
        SculptBrushTest test;
@@ -939,7 +920,7 @@ static void calc_area_normal_and_center_task_cb(void *userdata, const int n)
        bool use_original;
 
        unode = sculpt_undo_push_node(data->ob, data->nodes[n], SCULPT_UNDO_COORDS);
-       sculpt_brush_range_test_init(ss, &test, sampling_radius_pct);
+       sculpt_brush_test_init(ss, &test);
 
        use_original = (ss->cache->original && (unode->co || unode->bm_entry));
 
@@ -1065,8 +1046,7 @@ static void calc_area_center(
 
        SculptThreadedTaskData data = {
                .sd = sd, .ob = ob, .nodes = nodes, .totnode = totnode,
-               .has_bm_orco = has_bm_orco, .area_cos = area_cos, .area_nos = NULL,
-               .count = count, .brush = brush
+               .has_bm_orco = has_bm_orco, .area_cos = area_cos, .area_nos = NULL, .count = count,
        };
        BLI_mutex_init(&data.mutex);
 
@@ -1106,8 +1086,7 @@ static void calc_area_normal(
 
        SculptThreadedTaskData data = {
                .sd = sd, .ob = ob, .nodes = nodes, .totnode = totnode,
-               .has_bm_orco = has_bm_orco, .area_cos = NULL, .area_nos = area_nos,
-               .count = count, .brush = brush
+               .has_bm_orco = has_bm_orco, .area_cos = NULL, .area_nos = area_nos, .count = count,
        };
        BLI_mutex_init(&data.mutex);
 
@@ -1145,8 +1124,7 @@ static void calc_area_normal_and_center(
 
        SculptThreadedTaskData data = {
                .sd = sd, .ob = ob, .nodes = nodes, .totnode = totnode,
-               .has_bm_orco = has_bm_orco, .area_cos = area_cos, .area_nos = area_nos,
-               .count = count, .brush = brush
+               .has_bm_orco = has_bm_orco, .area_cos = area_cos, .area_nos = area_nos, .count = count,
        };
        BLI_mutex_init(&data.mutex);
 
@@ -1404,7 +1382,7 @@ static void sculpt_clip(Sculpt *sd, SculptSession *ss, float co[3], const float
 }
 
 /* Calculate primary direction of movement for many brushes */
-void calc_sculpt_normal(
+static void calc_sculpt_normal(
         Sculpt *sd, Object *ob,
         PBVHNode **nodes, int totnode,
         float r_area_no[3])
@@ -2848,7 +2826,6 @@ static float get_offset(Sculpt *sd, SculptSession *ss)
        return rv;
 }
 
-//Move up?
 static void do_flatten_brush_task_cb_ex(
         void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
 {
index 48b847bf743076bae2bdf25a5d0c639e975a31d8..f1475b179c57d7fd615e95de829d192ecb07363e 100644 (file)
@@ -44,7 +44,6 @@ struct bContext;
 struct Object;
 struct SculptUndoNode;
 
-
 int sculpt_mode_poll(struct bContext *C);
 int sculpt_mode_poll_view3d(struct bContext *C);
 /* checks for a brush, not just sculpt mode */
@@ -54,7 +53,6 @@ int sculpt_poll_view3d(struct bContext *C);
 /* Stroke */
 bool sculpt_stroke_get_location(bContext *C, float out[3], const float mouse[2]);
 
-
 /* Dynamic topology */
 void sculpt_pbvh_clear(Object *ob);
 void sculpt_dyntopo_node_layers_add(struct SculptSession *ss);
@@ -63,18 +61,6 @@ void sculpt_dynamic_topology_enable(struct bContext *C);
 void sculpt_dynamic_topology_disable(struct bContext *C,
                                      struct SculptUndoNode *unode);
 
-/* Calculate Sculpt Normals and Centers */
-void calc_sculpt_normal(struct Sculpt *sd,
-                       struct Object *ob,
-                       struct PBVHNode **nodes,
-                       int totnode,
-                       float r_area_no[3]);
-//void calc_area_normal(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float r_area_no[3]);
-//void calc_sculpt_plane(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float r_area_no[3], float r_area_co[3]);
-//void calc_area_normal_and_center(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float r_area_no[3], float r_area_co[3]);
-//void calc_area_center(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float r_area_co[3]);
-
-
 /* Undo */
 
 typedef enum SculptUndoType {
index 525653fe2005b2e2524aef7f31ba7a1cbd79b7fb..44bd872d107c9503b1e5c6ae7908d641cee4be14 100644 (file)
@@ -36,7 +36,6 @@
 
 #include "MEM_guardedalloc.h"
 
-#include "BLI_bitmap.h"
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
 #include "BLI_string.h"
index cfaa060e705f4c08aa157cc33e254090e1b6fae8..2f70e763b1532d7487e3081c3d017ee1e90ea1bf 100644 (file)
@@ -91,7 +91,6 @@ typedef struct Brush {
        float secondary_rgb[3]; /* background color */
 
        int sculpt_plane;       /* the direction of movement for sculpt vertices */
-       float sculpt_plane_range; /* adjust the range for determining the sculpt plane normal and center */
 
        float plane_offset;     /* offset for plane brushes (clay, flatten, fill, scrape) */
 
@@ -138,6 +137,8 @@ typedef struct Brush {
 
        float mask_stencil_pos[2];
        float mask_stencil_dimension[2];
+
+       float pad;
 } Brush;
 
 typedef struct PaletteColor {
index f084500bcae0830903c152f4d8459fb53f34291d..0188155858c37d2a186e1be6221f06b05df39812 100644 (file)
@@ -903,14 +903,6 @@ static void rna_def_brush(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Sculpt Plane", "");
        RNA_def_property_update(prop, 0, "rna_Brush_update");
 
-       prop= RNA_def_property(srna, "sculpt_plane_range", PROP_FLOAT, PROP_FACTOR);
-       RNA_def_property_float_sdna(prop, NULL, "sculpt_plane_range");
-       RNA_def_property_float_default(prop, 1.0f);
-       RNA_def_property_range(prop, 0.01f, 2.0f);
-       RNA_def_property_ui_text(prop, "Sculpt Plane Range", "Determines the range, in brush radii, to sample vertexes when determining the area sculpt plane");
-       RNA_def_property_update(prop, 0, "rna_Brush_update");
-
-
        prop = RNA_def_property(srna, "mask_tool", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_items(prop, brush_mask_tool_items);
        RNA_def_property_ui_text(prop, "Mask Tool", "");
@@ -1232,7 +1224,6 @@ static void rna_def_brush(BlenderRNA *brna)
                                 "Automatically adjust strength to give consistent results for different spacings");
        RNA_def_property_update(prop, 0, "rna_Brush_update");
 
-       /* adaptive space is not implemented yet */
        prop = RNA_def_property(srna, "use_adaptive_space", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ADAPTIVE_SPACE);
        RNA_def_property_ui_text(prop, "Adaptive Spacing",