Cleanup: Sculpt: Remove old draw sharp brush code

Missed in 750e3a6fba.
This commit is contained in:
Hans Goudey
2024-07-03 16:22:52 -04:00
parent a5b169c103
commit c1c2f8abd9
2 changed files with 0 additions and 75 deletions

View File

@@ -478,80 +478,6 @@ void SCULPT_do_elastic_deform_brush(const Sculpt &sd, Object &ob, Span<PBVHNode
});
}
/* -------------------------------------------------------------------- */
/** \name Sculpt Draw Sharp Brush
* \{ */
static void do_draw_sharp_brush_task(Object &ob,
const Brush &brush,
const float *offset,
PBVHNode *node)
{
using namespace blender::ed::sculpt_paint;
SculptSession &ss = *ob.sculpt;
PBVHVertexIter vd;
SculptOrigVertData orig_data = SCULPT_orig_vert_data_init(ob, *node, undo::Type::Position);
const MutableSpan<float3> proxy = BKE_pbvh_node_add_proxy(*ss.pbvh, *node).co;
SculptBrushTest test;
SculptBrushTestFn sculpt_brush_test_sq_fn = SCULPT_brush_test_init_with_falloff_shape(
ss, test, brush.falloff_shape);
const int thread_id = BLI_task_parallel_thread_id(nullptr);
auto_mask::NodeData automask_data = auto_mask::node_begin(
ob, ss.cache->automasking.get(), *node);
BKE_pbvh_vertex_iter_begin (*ss.pbvh, node, vd, PBVH_ITER_UNIQUE) {
SCULPT_orig_vert_data_update(orig_data, vd);
if (!sculpt_brush_test_sq_fn(test, orig_data.co)) {
continue;
}
/* Offset vertex. */
auto_mask::node_update(automask_data, vd);
const float fade = SCULPT_brush_strength_factor(ss,
brush,
orig_data.co,
sqrtf(test.dist),
orig_data.no,
nullptr,
vd.mask,
vd.vertex,
thread_id,
&automask_data);
mul_v3_v3fl(proxy[vd.i], offset, fade);
}
BKE_pbvh_vertex_iter_end;
}
void SCULPT_do_draw_sharp_brush(const Sculpt &sd, Object &ob, Span<PBVHNode *> nodes)
{
using namespace blender;
SculptSession &ss = *ob.sculpt;
const Brush &brush = *BKE_paint_brush_for_read(&sd.paint);
float offset[3];
const float bstrength = ss.cache->bstrength;
/* Offset with as much as possible factored in already. */
float effective_normal[3];
SCULPT_tilt_effective_normal_get(ss, brush, effective_normal);
mul_v3_v3fl(offset, effective_normal, ss.cache->radius);
mul_v3_v3(offset, ss.cache->scale);
mul_v3_fl(offset, bstrength);
/* XXX: this shouldn't be necessary, but sculpting crashes in blender2.8 otherwise
* initialize before threads so they can do curve mapping. */
BKE_curvemapping_init(brush.curve);
threading::parallel_for(nodes.index_range(), 1, [&](const IndexRange range) {
for (const int i : range) {
do_draw_sharp_brush_task(ob, brush, offset, nodes[i]);
}
});
}
/** \} */
/* -------------------------------------------------------------------- */

View File

@@ -2052,7 +2052,6 @@ float clay_thumb_get_stabilized_pressure(const blender::ed::sculpt_paint::Stroke
void SCULPT_do_snake_hook_brush(const Sculpt &sd, Object &ob, blender::Span<PBVHNode *> nodes);
void SCULPT_do_layer_brush(const Sculpt &sd, Object &ob, blender::Span<PBVHNode *> nodes);
void SCULPT_do_elastic_deform_brush(const Sculpt &sd, Object &ob, blender::Span<PBVHNode *> nodes);
void SCULPT_do_draw_sharp_brush(const Sculpt &sd, Object &ob, blender::Span<PBVHNode *> nodes);
void SCULPT_do_slide_relax_brush(const Sculpt &sd, Object &ob, blender::Span<PBVHNode *> nodes);
/** \} */