@@ -165,24 +165,6 @@ int SCULPT_vertex_count_get(const Object &object)
|
||||
return 0;
|
||||
}
|
||||
|
||||
const float *SCULPT_vertex_co_get(const Depsgraph &depsgraph,
|
||||
const Object &object,
|
||||
PBVHVertRef vertex)
|
||||
{
|
||||
const SculptSession &ss = *object.sculpt;
|
||||
switch (blender::bke::object::pbvh_get(object)->type()) {
|
||||
case blender::bke::pbvh::Type::Mesh:
|
||||
return blender::bke::pbvh::vert_positions_eval(depsgraph, object)[vertex.i];
|
||||
case blender::bke::pbvh::Type::BMesh:
|
||||
return ((BMVert *)vertex.i)->co;
|
||||
case blender::bke::pbvh::Type::Grids: {
|
||||
const SubdivCCG &subdiv_ccg = *ss.subdiv_ccg;
|
||||
return subdiv_ccg.positions[vertex.i];
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
namespace blender::ed::sculpt_paint {
|
||||
|
||||
Span<float3> vert_positions_for_grab_active_get(const Depsgraph &depsgraph, const Object &object)
|
||||
@@ -246,44 +228,6 @@ int active_face_set_get(const Object &object)
|
||||
|
||||
namespace face_set {
|
||||
|
||||
int vert_face_set_get(const Object &object, PBVHVertRef vertex)
|
||||
{
|
||||
const SculptSession &ss = *object.sculpt;
|
||||
switch (bke::object::pbvh_get(object)->type()) {
|
||||
case bke::pbvh::Type::Mesh: {
|
||||
const Mesh &mesh = *static_cast<const Mesh *>(object.data);
|
||||
const bke::AttributeAccessor attributes = mesh.attributes();
|
||||
const VArray face_sets = *attributes.lookup<int>(".sculpt_face_set", bke::AttrDomain::Face);
|
||||
if (!face_sets) {
|
||||
return SCULPT_FACE_SET_NONE;
|
||||
}
|
||||
const GroupedSpan<int> vert_to_face_map = mesh.vert_to_face_map();
|
||||
int face_set = 0;
|
||||
for (const int face_index : vert_to_face_map[vertex.i]) {
|
||||
if (face_sets[face_index] > face_set) {
|
||||
face_set = face_sets[face_index];
|
||||
}
|
||||
}
|
||||
return face_set;
|
||||
}
|
||||
case bke::pbvh::Type::BMesh:
|
||||
return 0;
|
||||
case bke::pbvh::Type::Grids: {
|
||||
const Mesh &mesh = *static_cast<const Mesh *>(object.data);
|
||||
const bke::AttributeAccessor attributes = mesh.attributes();
|
||||
const VArray face_sets = *attributes.lookup<int>(".sculpt_face_set", bke::AttrDomain::Face);
|
||||
if (!face_sets) {
|
||||
return SCULPT_FACE_SET_NONE;
|
||||
}
|
||||
const CCGKey key = BKE_subdiv_ccg_key_top_level(*ss.subdiv_ccg);
|
||||
const int grid_index = vertex.i / key.grid_area;
|
||||
const int face_index = BKE_subdiv_ccg_grid_to_face_index(*ss.subdiv_ccg, grid_index);
|
||||
return face_sets[face_index];
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int vert_face_set_get(const GroupedSpan<int> vert_to_face_map,
|
||||
const Span<int> face_sets,
|
||||
const int vert)
|
||||
|
||||
@@ -25,7 +25,6 @@ struct SubdivCCGCoord;
|
||||
namespace blender::ed::sculpt_paint::face_set {
|
||||
|
||||
int active_face_set_get(const Object &object);
|
||||
int vert_face_set_get(const Object &object, PBVHVertRef vertex);
|
||||
int vert_face_set_get(GroupedSpan<int> vert_to_face_map, Span<int> face_sets, int vert);
|
||||
int vert_face_set_get(const SubdivCCG &subdiv_ccg, Span<int> face_sets, int grid);
|
||||
int vert_face_set_get(int face_set_offset, const BMVert &vert);
|
||||
|
||||
@@ -23,11 +23,6 @@ struct Object;
|
||||
|
||||
namespace blender::ed::sculpt_paint::flood_fill {
|
||||
|
||||
struct FillData {
|
||||
std::queue<PBVHVertRef> queue;
|
||||
BitVector<> visited_verts;
|
||||
};
|
||||
|
||||
struct FillDataMesh {
|
||||
std::queue<int> queue;
|
||||
BitVector<> visited_verts;
|
||||
@@ -80,8 +75,4 @@ struct FillDataBMesh {
|
||||
void execute(Object &object, FunctionRef<bool(BMVert *from_v, BMVert *to_v)> func);
|
||||
};
|
||||
|
||||
void execute(Object &object,
|
||||
FillData &flood,
|
||||
FunctionRef<bool(PBVHVertRef from_v, PBVHVertRef to_v, bool is_duplicate)> func);
|
||||
|
||||
} // namespace blender::ed::sculpt_paint::flood_fill
|
||||
|
||||
@@ -37,31 +37,6 @@ Span<int> node_visible_verts(const bke::pbvh::MeshNode &node,
|
||||
return indices;
|
||||
}
|
||||
|
||||
bool vert_visible_get(const Object &object, PBVHVertRef vertex)
|
||||
{
|
||||
const SculptSession &ss = *object.sculpt;
|
||||
switch (bke::object::pbvh_get(object)->type()) {
|
||||
case bke::pbvh::Type::Mesh: {
|
||||
const Mesh &mesh = *static_cast<const Mesh *>(object.data);
|
||||
const bke::AttributeAccessor attributes = mesh.attributes();
|
||||
const VArray hide_vert = *attributes.lookup_or_default<bool>(
|
||||
".hide_vert", bke::AttrDomain::Point, false);
|
||||
return !hide_vert[vertex.i];
|
||||
}
|
||||
case bke::pbvh::Type::BMesh:
|
||||
return !BM_elem_flag_test((BMVert *)vertex.i, BM_ELEM_HIDDEN);
|
||||
case bke::pbvh::Type::Grids: {
|
||||
const CCGKey key = BKE_subdiv_ccg_key_top_level(*ss.subdiv_ccg);
|
||||
const int grid_index = vertex.i / key.grid_area;
|
||||
const int index_in_grid = vertex.i - grid_index * key.grid_area;
|
||||
if (!ss.subdiv_ccg->grid_hidden.is_empty()) {
|
||||
return !ss.subdiv_ccg->grid_hidden[grid_index][index_in_grid];
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool vert_all_faces_visible_get(const Span<bool> hide_poly,
|
||||
const GroupedSpan<int> vert_to_face_map,
|
||||
const int vert)
|
||||
|
||||
@@ -27,8 +27,6 @@ Span<int> node_visible_verts(const bke::pbvh::MeshNode &node,
|
||||
Span<bool> hide_vert,
|
||||
Vector<int> &indices);
|
||||
|
||||
bool vert_visible_get(const Object &object, PBVHVertRef vertex);
|
||||
|
||||
/* Determines if all faces attached to a given vertex are visible. */
|
||||
bool vert_all_faces_visible_get(Span<bool> hide_poly, GroupedSpan<int> vert_to_face_map, int vert);
|
||||
bool vert_all_faces_visible_get(Span<bool> hide_poly,
|
||||
|
||||
@@ -506,9 +506,6 @@ void sculpt_project_v3_normal_align(const SculptSession &ss,
|
||||
void SCULPT_vertex_random_access_ensure(Object &object);
|
||||
|
||||
int SCULPT_vertex_count_get(const Object &object);
|
||||
const float *SCULPT_vertex_co_get(const Depsgraph &depsgraph,
|
||||
const Object &object,
|
||||
PBVHVertRef vertex);
|
||||
|
||||
bool SCULPT_vertex_is_occluded(const Depsgraph &depsgraph,
|
||||
const Object &object,
|
||||
|
||||
Reference in New Issue
Block a user