Fix Boundary Brush not working with partially hidden meshes

Now when a mesh is partially hidden using Face Sets, the open boundary
the hidden geometry produces is also detected by the brush.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8819
This commit is contained in:
Pablo Dobarro 2020-09-06 19:38:37 +02:00
parent 0c4b732ef2
commit bbbfd7130a
1 changed files with 16 additions and 4 deletions

View File

@ -74,6 +74,10 @@ static bool boundary_initial_vertex_floodfill_cb(
{
BoundaryInitialVertexFloodFillData *data = userdata;
if (!SCULPT_vertex_visible_get(ss, to_v)) {
return false;
}
if (!is_duplicate) {
data->floodfill_steps[to_v] = data->floodfill_steps[from_v] + 1;
}
@ -174,13 +178,19 @@ static bool sculpt_boundary_is_vertex_in_editable_boundary(SculptSession *ss,
const int initial_vertex)
{
if (!SCULPT_vertex_visible_get(ss, initial_vertex)) {
return false;
}
int neighbor_count = 0;
int boundary_vertex_count = 0;
SculptVertexNeighborIter ni;
SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, initial_vertex, ni) {
neighbor_count++;
if (SCULPT_vertex_is_boundary(ss, ni.index)) {
boundary_vertex_count++;
if (SCULPT_vertex_visible_get(ss, ni.index)) {
neighbor_count++;
if (SCULPT_vertex_is_boundary(ss, ni.index)) {
boundary_vertex_count++;
}
}
}
SCULPT_VERTEX_NEIGHBORS_ITER_END(ni);
@ -349,7 +359,9 @@ static void sculpt_boundary_edit_data_init(SculptSession *ss,
SculptVertexNeighborIter ni;
SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN (ss, from_v, ni) {
if (boundary->edit_info[ni.index].num_propagation_steps == BOUNDARY_STEPS_NONE) {
const bool is_visible = SCULPT_vertex_visible_get(ss, ni.index);
if (is_visible &&
boundary->edit_info[ni.index].num_propagation_steps == BOUNDARY_STEPS_NONE) {
boundary->edit_info[ni.index].original_vertex =
boundary->edit_info[from_v].original_vertex;