Fix #116389: Sculpt: Box Hide tool keymap option "Outside" not working

Both inside/outside was hiding verts that are within `isect_point_planes_v3`.
For VisArea::Outside, verts outside the box should be hidden (same for
"show").

Pull Request: https://projects.blender.org/blender/blender/pulls/116412
This commit is contained in:
Pratik Borhade
2023-12-23 06:27:12 +01:00
committed by Pratik Borhade
parent e18e4a1acf
commit 574daf20e1

View File

@@ -235,7 +235,7 @@ static void partialvis_update_mesh(Object &object,
const Span<float3> positions = BKE_pbvh_get_vert_positions(&pbvh);
vert_hide_update(object, nodes, [&](const Span<int> verts, MutableSpan<bool> hide) {
for (const int i : verts.index_range()) {
if (isect_point_planes_v3(planes, 4, positions[verts[i]])) {
if (isect_point_planes_v3(planes, 4, positions[verts[i]]) == (area == VisArea::Inside)) {
hide[i] = value;
}
}
@@ -381,7 +381,9 @@ static void partialvis_update_grids(Depsgraph &depsgraph,
for (const int y : IndexRange(key.grid_size)) {
for (const int x : IndexRange(key.grid_size)) {
CCGElem *elem = CCG_grid_elem(&key, grid, x, y);
if (isect_point_planes_v3(planes, 4, CCG_elem_co(&key, elem))) {
if (isect_point_planes_v3(planes, 4, CCG_elem_co(&key, elem)) ==
(area == VisArea::Inside))
{
hide[y * key.grid_size + x].set(value);
}
}