Cleanup: Sculpt: Move multi-plane scrape code to C++ namespace
This commit is contained in:
@@ -2,9 +2,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup edsculpt
|
||||
*/
|
||||
#include "editors/sculpt_paint/brushes/types.hh"
|
||||
|
||||
#include "BLI_math_matrix.h"
|
||||
#include "BLI_math_matrix.hh"
|
||||
@@ -30,8 +28,7 @@
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
|
||||
using blender::float3;
|
||||
using blender::MutableSpan;
|
||||
namespace blender::ed::sculpt_paint {
|
||||
|
||||
struct MultiplaneScrapeSampleData {
|
||||
float area_cos[2][3];
|
||||
@@ -45,7 +42,6 @@ static void calc_multiplane_scrape_surface_task(Object &ob,
|
||||
PBVHNode *node,
|
||||
MultiplaneScrapeSampleData *mssd)
|
||||
{
|
||||
using namespace blender::ed::sculpt_paint;
|
||||
SculptSession &ss = *ob.sculpt;
|
||||
|
||||
PBVHVertexIter vd;
|
||||
@@ -108,7 +104,6 @@ static void do_multiplane_scrape_brush_task(Object &ob,
|
||||
const float angle,
|
||||
PBVHNode *node)
|
||||
{
|
||||
using namespace blender::ed::sculpt_paint;
|
||||
SculptSession &ss = *ob.sculpt;
|
||||
|
||||
PBVHVertexIter vd;
|
||||
@@ -185,14 +180,8 @@ static void do_multiplane_scrape_brush_task(Object &ob,
|
||||
BKE_pbvh_vertex_iter_end;
|
||||
}
|
||||
|
||||
/* Public functions. */
|
||||
|
||||
void SCULPT_do_multiplane_scrape_brush(const Sculpt &sd,
|
||||
Object &ob,
|
||||
blender::Span<PBVHNode *> nodes)
|
||||
void do_multiplane_scrape_brush(const Sculpt &sd, Object &ob, const Span<PBVHNode *> nodes)
|
||||
{
|
||||
using namespace blender;
|
||||
using namespace blender::ed::sculpt_paint;
|
||||
SculptSession &ss = *ob.sculpt;
|
||||
const Brush &brush = *BKE_paint_brush_for_read(&sd.paint);
|
||||
|
||||
@@ -366,13 +355,12 @@ void SCULPT_do_multiplane_scrape_brush(const Sculpt &sd,
|
||||
});
|
||||
}
|
||||
|
||||
void SCULPT_multiplane_scrape_preview_draw(const uint gpuattr,
|
||||
const Brush &brush,
|
||||
const SculptSession &ss,
|
||||
const float outline_col[3],
|
||||
const float outline_alpha)
|
||||
void multiplane_scrape_preview_draw(const uint gpuattr,
|
||||
const Brush &brush,
|
||||
const SculptSession &ss,
|
||||
const float outline_col[3],
|
||||
const float outline_alpha)
|
||||
{
|
||||
using namespace blender;
|
||||
if (!(brush.flag2 & BRUSH_MULTIPLANE_SCRAPE_PLANES_PREVIEW)) {
|
||||
return;
|
||||
}
|
||||
@@ -434,3 +422,5 @@ void SCULPT_multiplane_scrape_preview_draw(const uint gpuattr,
|
||||
|
||||
immEnd();
|
||||
}
|
||||
|
||||
} // namespace blender::ed::sculpt_paint
|
||||
|
||||
@@ -28,6 +28,7 @@ void do_grab_brush(const Sculpt &sd, Object &ob, Span<PBVHNode *> nodes);
|
||||
void do_inflate_brush(const Sculpt &sd, Object &ob, Span<PBVHNode *> nodes);
|
||||
/** A brush that modifies mask values instead of position. */
|
||||
void do_mask_brush(const Sculpt &sd, Object &object, Span<PBVHNode *> nodes);
|
||||
void do_multiplane_scrape_brush(const Sculpt &sd, Object &object, Span<PBVHNode *> nodes);
|
||||
void do_nudge_brush(const Sculpt &sd, Object &object, Span<PBVHNode *> nodes);
|
||||
void do_scrape_brush(const Sculpt &sd, Object &object, Span<PBVHNode *> nodes);
|
||||
/** Smooth positions with neighboring vertices. */
|
||||
|
||||
@@ -1946,7 +1946,7 @@ static void paint_cursor_cursor_draw_3d_view_brush_cursor_active(PaintCursorCont
|
||||
}
|
||||
|
||||
if (brush.sculpt_tool == SCULPT_TOOL_MULTIPLANE_SCRAPE) {
|
||||
SCULPT_multiplane_scrape_preview_draw(
|
||||
multiplane_scrape_preview_draw(
|
||||
pcontext->pos, brush, ss, pcontext->outline_col, pcontext->outline_alpha);
|
||||
}
|
||||
|
||||
|
||||
@@ -3843,7 +3843,7 @@ static void do_brush_action(const Scene &scene,
|
||||
do_clay_strips_brush(sd, ob, nodes);
|
||||
break;
|
||||
case SCULPT_TOOL_MULTIPLANE_SCRAPE:
|
||||
SCULPT_do_multiplane_scrape_brush(sd, ob, nodes);
|
||||
do_multiplane_scrape_brush(sd, ob, nodes);
|
||||
break;
|
||||
case SCULPT_TOOL_CLAY_THUMB:
|
||||
SCULPT_do_clay_thumb_brush(sd, ob, nodes);
|
||||
|
||||
@@ -1958,19 +1958,14 @@ void pivot_line_preview_draw(uint gpuattr, SculptSession &ss);
|
||||
|
||||
}
|
||||
|
||||
/* Multi-plane Scrape Brush. */
|
||||
/* Main Brush Function. */
|
||||
void SCULPT_do_multiplane_scrape_brush(const Sculpt &sd,
|
||||
Object &ob,
|
||||
blender::Span<PBVHNode *> nodes);
|
||||
void SCULPT_multiplane_scrape_preview_draw(uint gpuattr,
|
||||
const Brush &brush,
|
||||
const SculptSession &ss,
|
||||
const float outline_col[3],
|
||||
float outline_alpha);
|
||||
|
||||
namespace blender::ed::sculpt_paint {
|
||||
|
||||
void multiplane_scrape_preview_draw(uint gpuattr,
|
||||
const Brush &brush,
|
||||
const SculptSession &ss,
|
||||
const float outline_col[3],
|
||||
float outline_alpha);
|
||||
|
||||
namespace face_set {
|
||||
|
||||
void do_draw_face_sets_brush(const Sculpt &sd, Object &ob, Span<PBVHNode *> nodes);
|
||||
|
||||
Reference in New Issue
Block a user