[Bf-blender-cvs] [1cfee604193] master: Cleanup: add 'sphere' to sculpt test function name
Campbell Barton
noreply at git.blender.org
Mon Oct 2 12:55:02 CEST 2017
Commit: 1cfee604193bed201ea2003c1f86b30da3b4035f
Author: Campbell Barton
Date: Mon Oct 2 12:18:35 2017 +1100
Branches: master
https://developer.blender.org/rB1cfee604193bed201ea2003c1f86b30da3b4035f
Cleanup: add 'sphere' to sculpt test function name
===================================================================
M source/blender/editors/sculpt_paint/paint_vertex.c
M source/blender/editors/sculpt_paint/sculpt.c
M source/blender/editors/sculpt_paint/sculpt_intern.h
===================================================================
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 78ebd382908..7b534e12f31 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1443,7 +1443,7 @@ static void do_wpaint_brush_blur_task_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
/* Test to see if the vertex coordinates are within the spherical brush region. */
- if (sculpt_brush_test_sq(&test, vd.co)) {
+ if (sculpt_brush_test_sphere_sq(&test, vd.co)) {
/* For grid based pbvh, take the vert whose loop coopresponds to the current grid.
* Otherwise, take the current vert. */
const int v_index = ccgdm ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
@@ -1529,7 +1529,7 @@ static void do_wpaint_brush_smear_task_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
/* Test to see if the vertex coordinates are within the spherical brush region. */
- if (sculpt_brush_test_fast(&test, vd.co)) {
+ if (sculpt_brush_test_sphere_fast(&test, vd.co)) {
const float view_dot = (vd.no) ? dot_vf3vs3(cache->sculpt_normal_symm, vd.no) : 1.0;
if (view_dot > 0.0f) {
bool do_color = false;
@@ -1623,7 +1623,7 @@ static void do_wpaint_brush_draw_task_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
/* Test to see if the vertex coordinates are within the spherical brush region. */
- if (sculpt_brush_test_sq(&test, vd.co)) {
+ if (sculpt_brush_test_sphere_sq(&test, vd.co)) {
/* Note: grids are 1:1 with corners (aka loops).
* For multires, take the vert whose loop cooresponds to the current grid.
* Otherwise, take the current vert. */
@@ -1691,7 +1691,7 @@ static void do_wpaint_brush_calc_average_weight_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
/* Test to see if the vertex coordinates are within the spherical brush region. */
- if (sculpt_brush_test_sq(&test, vd.co)) {
+ if (sculpt_brush_test_sphere_sq(&test, vd.co)) {
const float view_dot = (vd.no) ? dot_vf3vs3(cache->sculpt_normal_symm, vd.no) : 1.0;
if (view_dot > 0.0 && BKE_brush_curve_strength(data->brush, sqrtf(test.dist), cache->radius) > 0.0) {
const int v_index = ccgdm ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
@@ -2294,7 +2294,7 @@ static void do_vpaint_brush_calc_average_color_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
/* Test to see if the vertex coordinates are within the spherical brush region. */
- if (sculpt_brush_test_fast(&test, vd.co)) {
+ if (sculpt_brush_test_sphere_fast(&test, vd.co)) {
const int v_index = ccgdm ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
if (BKE_brush_curve_strength(data->brush, test.dist, cache->radius) > 0.0) {
/* If the vertex is selected for painting. */
@@ -2362,7 +2362,7 @@ static void do_vpaint_brush_draw_task_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
/* Test to see if the vertex coordinates are within the spherical brush region. */
- if (sculpt_brush_test_sq(&test, vd.co)) {
+ if (sculpt_brush_test_sphere_sq(&test, vd.co)) {
/* Note: Grids are 1:1 with corners (aka loops).
* For grid based pbvh, take the vert whose loop cooresponds to the current grid.
* Otherwise, take the current vert. */
@@ -2453,7 +2453,7 @@ static void do_vpaint_brush_blur_task_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
/* Test to see if the vertex coordinates are within the spherical brush region. */
- if (sculpt_brush_test_sq(&test, vd.co)) {
+ if (sculpt_brush_test_sphere_sq(&test, vd.co)) {
/* For grid based pbvh, take the vert whose loop cooresponds to the current grid.
* Otherwise, take the current vert. */
const int v_index = ccgdm ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
@@ -2563,7 +2563,7 @@ static void do_vpaint_brush_smear_task_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
/* Test to see if the vertex coordinates are within the spherical brush region. */
- if (sculpt_brush_test_sq(&test, vd.co)) {
+ if (sculpt_brush_test_sphere_sq(&test, vd.co)) {
/* For grid based pbvh, take the vert whose loop cooresponds to the current grid.
* Otherwise, take the current vert. */
const int v_index = ccgdm ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index bef682868c3..1427f03f92c 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -544,7 +544,7 @@ BLI_INLINE bool sculpt_brush_test_clipping(const SculptBrushTest *test, const fl
return ED_view3d_clipping_test(rv3d, symm_co, true);
}
-bool sculpt_brush_test(SculptBrushTest *test, const float co[3])
+bool sculpt_brush_test_sphere(SculptBrushTest *test, const float co[3])
{
float distsq = len_squared_v3v3(co, test->location);
@@ -560,7 +560,7 @@ bool sculpt_brush_test(SculptBrushTest *test, const float co[3])
}
}
-bool sculpt_brush_test_sq(SculptBrushTest *test, const float co[3])
+bool sculpt_brush_test_sphere_sq(SculptBrushTest *test, const float co[3])
{
float distsq = len_squared_v3v3(co, test->location);
@@ -576,7 +576,7 @@ bool sculpt_brush_test_sq(SculptBrushTest *test, const float co[3])
}
}
-bool sculpt_brush_test_fast(const SculptBrushTest *test, const float co[3])
+bool sculpt_brush_test_sphere_fast(const SculptBrushTest *test, const float co[3])
{
if (sculpt_brush_test_clipping(test, co)) {
return 0;
@@ -639,7 +639,7 @@ static float frontface(Brush *br, const float sculpt_normal[3],
static bool sculpt_brush_test_cyl(SculptBrushTest *test, float co[3], float location[3], const float area_no[3])
{
- if (sculpt_brush_test_fast(test, co)) {
+ if (sculpt_brush_test_sphere_fast(test, co)) {
float t1[3], t2[3], t3[3], dist;
sub_v3_v3v3(t1, location, co);
@@ -786,7 +786,7 @@ static void calc_area_normal_and_center_task_cb(void *userdata, const int n)
closest_on_tri_to_point_v3(co, test.location, UNPACK3(co_tri));
- if (sculpt_brush_test_fast(&test, co)) {
+ if (sculpt_brush_test_sphere_fast(&test, co)) {
float no[3];
int flip_index;
@@ -820,7 +820,7 @@ static void calc_area_normal_and_center_task_cb(void *userdata, const int n)
co = vd.co;
}
- if (sculpt_brush_test_fast(&test, co)) {
+ if (sculpt_brush_test_sphere_fast(&test, co)) {
float no_buf[3];
const float *no;
int flip_index;
@@ -1530,7 +1530,7 @@ static void do_smooth_brush_mesh_task_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
- if (sculpt_brush_test(&test, vd.co)) {
+ if (sculpt_brush_test_sphere(&test, vd.co)) {
const float fade = bstrength * tex_strength(
ss, brush, vd.co, test.dist, vd.no, vd.fno,
smooth_mask ? 0.0f : (vd.mask ? *vd.mask : 0.0f),
@@ -1578,7 +1578,7 @@ static void do_smooth_brush_bmesh_task_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
- if (sculpt_brush_test(&test, vd.co)) {
+ if (sculpt_brush_test_sphere(&test, vd.co)) {
const float fade = bstrength * tex_strength(
ss, brush, vd.co, test.dist, vd.no, vd.fno, smooth_mask ? 0.0f : *vd.mask,
thread_id);
@@ -1717,7 +1717,7 @@ static void do_smooth_brush_multires_task_cb_ex(
fno = CCG_elem_offset_no(&key, gddata, index);
mask = CCG_elem_offset_mask(&key, gddata, index);
- if (sculpt_brush_test(&test, co)) {
+ if (sculpt_brush_test_sphere(&test, co)) {
const float strength_mask = (smooth_mask ? 0.0f : *mask);
const float fade = bstrength * tex_strength(
ss, brush, co, test.dist, NULL, fno, strength_mask, thread_id);
@@ -1837,7 +1837,7 @@ static void do_mask_brush_draw_task_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
- if (sculpt_brush_test(&test, vd.co)) {
+ if (sculpt_brush_test_sphere(&test, vd.co)) {
const float fade = tex_strength(ss, brush, vd.co, test.dist, vd.no, vd.fno, 0.0f, thread_id);
(*vd.mask) += fade * bstrength;
@@ -1897,7 +1897,7 @@ static void do_draw_brush_task_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
- if (sculpt_brush_test(&test, vd.co)) {
+ if (sculpt_brush_test_sphere(&test, vd.co)) {
/* offset vertex */
const float fade = tex_strength(
ss, brush, vd.co, test.dist, vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, thread_id);
@@ -1954,7 +1954,7 @@ static void do_crease_brush_task_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
- if (sculpt_brush_test(&test, vd.co)) {
+ if (sculpt_brush_test_sphere(&test, vd.co)) {
/* offset vertex */
const float fade = tex_strength(
ss, brush, vd.co, test.dist, vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, thread_id);
@@ -2040,7 +2040,7 @@ static void do_pinch_brush_task_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
- if (sculpt_brush_test(&test, vd.co)) {
+ if (sculpt_brush_test_sphere(&test, vd.co)) {
const float fade = bstrength * tex_strength(
ss, brush, vd.co, test.dist, vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, thread_id);
float val[3];
@@ -2092,7 +2092,7 @@ static void do_grab_brush_task_cb_ex(
{
sculpt_orig_vert_data_update(&orig_data, &vd);
- if (sculpt_brush_test(&test, orig_data.co)) {
+ if (sculpt_brush_test_sphere(&test, orig_data.co)) {
const float fade = bstrength * tex_strength(
ss, brush, orig_data.co, test.dist, orig_data.no, NULL, vd.mask ? *vd.mask : 0.0f,
thread_id);
@@ -2147,7 +2147,7 @
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list