Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c16
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c50
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_intern.h6
3 files changed, 36 insertions, 36 deletions
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 @@ static void do_nudge_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);
@@ -2206,7 +2206,7 @@ static void do_snake_hook_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);
@@ -2307,7 +2307,7 @@ static void do_thumb_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);
@@ -2367,7 +2367,7 @@ static void do_rotate_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)) {
float vec[3], rot[3][3];
const float fade = bstrength * tex_strength(
ss, brush, orig_data.co, test.dist, orig_data.no, NULL, vd.mask ? *vd.mask : 0.0f,
@@ -2435,7 +2435,7 @@ static void do_layer_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, vd.co, test.dist, vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, thread_id);
float *disp = &layer_disp[vd.i];
@@ -2507,7 +2507,7 @@ static void do_inflate_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];
@@ -2685,7 +2685,7 @@ static void do_flatten_brush_task_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
- if (sculpt_brush_test_sq(&test, vd.co)) {
+ if (sculpt_brush_test_sphere_sq(&test, vd.co)) {
float intr[3];
float val[3];
@@ -2761,7 +2761,7 @@ static void do_clay_brush_task_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
- if (sculpt_brush_test_sq(&test, vd.co)) {
+ if (sculpt_brush_test_sphere_sq(&test, vd.co)) {
if (plane_point_side_flip(vd.co, area_no, area_co, flip)) {
float intr[3];
float val[3];
@@ -2952,7 +2952,7 @@ static void do_fill_brush_task_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
- if (sculpt_brush_test_sq(&test, vd.co)) {
+ if (sculpt_brush_test_sphere_sq(&test, vd.co)) {
if (plane_point_side(vd.co, area_no, area_co)) {
float intr[3];
float val[3];
@@ -3030,7 +3030,7 @@ static void do_scrape_brush_task_cb_ex(
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
- if (sculpt_brush_test_sq(&test, vd.co)) {
+ if (sculpt_brush_test_sphere_sq(&test, vd.co)) {
if (!plane_point_side(vd.co, area_no, area_co)) {
float intr[3];
float val[3];
@@ -3105,7 +3105,7 @@ static void do_gravity_task_cb_ex(
sculpt_brush_test_init(ss, &test);
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) {
- if (sculpt_brush_test_sq(&test, vd.co)) {
+ if (sculpt_brush_test_sphere_sq(&test, vd.co)) {
const float fade = tex_strength(
ss, brush, vd.co, sqrtf(test.dist), vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f,
thread_id);
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index 27d8fbaa340..05b33517a35 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -193,9 +193,9 @@ typedef struct {
} SculptSearchSphereData;
void sculpt_brush_test_init(struct SculptSession *ss, SculptBrushTest *test);
-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_fast(const SculptBrushTest *test, const float co[3]);
+bool sculpt_brush_test_sphere(SculptBrushTest *test, const float co[3]);
+bool sculpt_brush_test_sphere_sq(SculptBrushTest *test, const float co[3]);
+bool sculpt_brush_test_sphere_fast(const SculptBrushTest *test, const float co[3]);
bool sculpt_brush_test_cube(SculptBrushTest *test, const float co[3], float local[4][4]);
bool sculpt_search_sphere_cb(PBVHNode *node, void *data_v);
float tex_strength(