index-of-nearest-104619 #2

Merged
Iliya Katushenock merged 62 commits from HooglyBoogly/blender:index-of-nearest-104619 into index_of_nearest 2023-04-20 21:19:53 +02:00
Showing only changes of commit e05cbad0d1 - Show all commits

View File

@ -148,8 +148,24 @@ static bool sculpt_expand_is_face_in_active_component(SculptSession *ss,
ExpandCache *expand_cache, ExpandCache *expand_cache,
const int f) const int f)
{ {
const int vert = ss->corner_verts[ss->polys[f].start()]; PBVHVertRef vertex;
return sculpt_expand_is_vert_in_active_component(ss, expand_cache, BKE_pbvh_make_vref(vert));
switch (BKE_pbvh_type(ss->pbvh)) {
case PBVH_FACES:
vertex.i = ss->corner_verts[ss->polys[f].start()];
break;
case PBVH_GRIDS: {
const CCGKey *key = BKE_pbvh_get_grid_key(ss->pbvh);
vertex.i = ss->polys[f].start() * key->grid_area;
break;
}
case PBVH_BMESH: {
vertex.i = reinterpret_cast<intptr_t>(ss->bm->ftable[f]->l_first->v);
break;
}
}
return sculpt_expand_is_vert_in_active_component(ss, expand_cache, vertex);
} }
/** /**