Refactor: Simplify boundary::preview_data_init parameters
* Since displaying this information will only ever happen based on the active vert, remove the parameter and fetch it inside the function * Remove the `PBVHVertRef` usage in favor of `ActiveVert` Pull Request: https://projects.blender.org/blender/blender/pulls/126256
This commit is contained in:
@@ -1732,7 +1732,7 @@ static void paint_cursor_preview_boundary_data_update(PaintCursorContext *pconte
|
||||
BKE_sculpt_update_object_for_edit(pcontext->depsgraph, pcontext->vc.obact, false);
|
||||
|
||||
ss.boundary_preview = boundary::preview_data_init(
|
||||
*pcontext->vc.obact, pcontext->brush, ss.active_vert_ref(), pcontext->radius);
|
||||
*pcontext->vc.obact, pcontext->brush, pcontext->radius);
|
||||
}
|
||||
|
||||
static void paint_cursor_draw_3d_view_brush_cursor_inactive(PaintCursorContext *pcontext)
|
||||
|
||||
@@ -3611,10 +3611,31 @@ std::unique_ptr<SculptBoundary> data_init_bmesh(Object &object,
|
||||
|
||||
std::unique_ptr<SculptBoundaryPreview> preview_data_init(Object &object,
|
||||
const Brush *brush,
|
||||
const PBVHVertRef initial_vert,
|
||||
const float radius)
|
||||
{
|
||||
std::unique_ptr<SculptBoundary> boundary = data_init(object, brush, initial_vert, radius);
|
||||
const SculptSession &ss = *object.sculpt;
|
||||
ActiveVert initial_vert = ss.active_vert();
|
||||
|
||||
if (std::holds_alternative<std::monostate>(initial_vert)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<SculptBoundary> boundary = nullptr;
|
||||
switch (ss.pbvh->type()) {
|
||||
case bke::pbvh::Type::Mesh:
|
||||
boundary = data_init_mesh(object, brush, std::get<int>(initial_vert), radius);
|
||||
break;
|
||||
case bke::pbvh::Type::Grids:
|
||||
boundary = data_init_grids(object, brush, std::get<SubdivCCGCoord>(initial_vert), radius);
|
||||
break;
|
||||
case bke::pbvh::Type::BMesh:
|
||||
boundary = data_init_bmesh(object, brush, std::get<BMVert *>(initial_vert), radius);
|
||||
break;
|
||||
default:
|
||||
BLI_assert_unreachable();
|
||||
break;
|
||||
}
|
||||
|
||||
if (boundary == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -2083,7 +2083,6 @@ std::unique_ptr<SculptBoundary> data_init_bmesh(Object &object,
|
||||
float radius);
|
||||
std::unique_ptr<SculptBoundaryPreview> preview_data_init(Object &object,
|
||||
const Brush *brush,
|
||||
PBVHVertRef initial_vertex,
|
||||
float radius);
|
||||
|
||||
/* Main Brush Function. */
|
||||
|
||||
Reference in New Issue
Block a user