[Bf-blender-cvs] [5fa1b47494f] soc-2017-sculpting_improvements: Small cleanup. Cleared every unconnected changes and fixed some minor ui bugs.
witt
noreply at git.blender.org
Thu Jun 1 11:13:51 CEST 2017
Commit: 5fa1b47494fae3caed358f4aebc32425b77ffdfa
Author: witt
Date: Thu Jun 1 11:10:03 2017 +0200
Branches: soc-2017-sculpting_improvements
https://developer.blender.org/rB5fa1b47494fae3caed358f4aebc32425b77ffdfa
Small cleanup. Cleared every unconnected changes and fixed some minor ui bugs.
===================================================================
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
M source/blender/blenkernel/intern/brush.c
M source/blender/blenloader/intern/versioning_270.c
M source/blender/editors/sculpt_paint/paint_stroke.c
M source/blender/editors/sculpt_paint/sculpt.c
M source/blender/editors/sculpt_paint/sculpt_intern.h
M source/blender/editors/sculpt_paint/sculpt_undo.c
M source/blender/makesdna/DNA_brush_types.h
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 7701ea712cb..8d375ec861c 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -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")
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 80aa8efa0a9..1a9295d579e 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -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;
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 09ba7f23809..d3260db1477 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -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) {
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index d6dd6be0d75..158ada1a2ea 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -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)) {
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index a4cf9800b80..e59b144836e 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -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)
{
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index 48b847bf743..f1475b179c5 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -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 {
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 525653fe200..44bd872d107 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -36,7 +36,6 @@
#include "MEM_guardedalloc.h"
-#include "BLI_bitmap.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_string.h"
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index cfaa060e705..2f70e763b15 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -91,7 +91,6
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list