Cleanup: Remove unused sculpt code

Remove abstract edge and face types. The design is to not abstract away
the code data structures like this and focus on sharing code more with the
rest of Blender rather than within sculpt mode.
This commit is contained in:
Hans Goudey
2023-12-14 18:25:20 -05:00
parent b3aca5b28f
commit c8aecac001
5 changed files with 0 additions and 94 deletions

View File

@@ -809,27 +809,6 @@ BLI_INLINE void *BKE_sculpt_vertex_attr_get(const PBVHVertRef vertex, const Scul
return NULL;
}
BLI_INLINE void *BKE_sculpt_face_attr_get(const PBVHFaceRef vertex, const SculptAttribute *attr)
{
if (attr->data) {
char *p = (char *)attr->data;
int idx = (int)vertex.i;
if (attr->data_for_bmesh) {
BMElem *v = (BMElem *)vertex.i;
idx = v->head.index;
}
return p + attr->elem_size * (int)idx;
}
else {
BMElem *v = (BMElem *)vertex.i;
return BM_ELEM_CD_GET_VOID_P(v, attr->bmesh_cd_offset);
}
return NULL;
}
/**
* Create new color layer on object if it doesn't have one and if experimental feature set has
* sculpt vertex color enabled. Returns truth if new layer has been added, false otherwise.

View File

@@ -65,20 +65,6 @@ struct PBVHVertRef {
PBVH_REF_CXX_METHODS(PBVHVertRef)
};
/* NOTE: edges in PBVH_GRIDS are always pulled from the base mesh. */
struct PBVHEdgeRef {
intptr_t i;
PBVH_REF_CXX_METHODS(PBVHVertRef)
};
/* NOTE: faces in PBVH_GRIDS are always puled from the base mesh. */
struct PBVHFaceRef {
intptr_t i;
PBVH_REF_CXX_METHODS(PBVHVertRef)
};
#define PBVH_REF_NONE -1LL
/* Public members of PBVH, used for inlined functions. */

View File

@@ -111,18 +111,6 @@ BLI_INLINE PBVHVertRef BKE_pbvh_make_vref(intptr_t i)
return ret;
}
BLI_INLINE PBVHEdgeRef BKE_pbvh_make_eref(intptr_t i)
{
PBVHEdgeRef ret = {i};
return ret;
}
BLI_INLINE PBVHFaceRef BKE_pbvh_make_fref(intptr_t i)
{
PBVHFaceRef ret = {i};
return ret;
}
BLI_INLINE int BKE_pbvh_vertex_to_index(PBVH *pbvh, PBVHVertRef v)
{
return (BKE_pbvh_type(pbvh) == PBVH_BMESH && v.i != PBVH_REF_NONE ?
@@ -143,46 +131,6 @@ BLI_INLINE PBVHVertRef BKE_pbvh_index_to_vertex(PBVH *pbvh, int index)
return BKE_pbvh_make_vref(PBVH_REF_NONE);
}
BLI_INLINE int BKE_pbvh_edge_to_index(PBVH *pbvh, PBVHEdgeRef e)
{
return (BKE_pbvh_type(pbvh) == PBVH_BMESH && e.i != PBVH_REF_NONE ?
BM_elem_index_get((BMEdge *)(e.i)) :
(e.i));
}
BLI_INLINE PBVHEdgeRef BKE_pbvh_index_to_edge(PBVH *pbvh, int index)
{
switch (BKE_pbvh_type(pbvh)) {
case PBVH_FACES:
case PBVH_GRIDS:
return BKE_pbvh_make_eref(index);
case PBVH_BMESH:
return BKE_pbvh_make_eref((intptr_t)BKE_pbvh_get_bmesh(pbvh)->etable[index]);
}
return BKE_pbvh_make_eref(PBVH_REF_NONE);
}
BLI_INLINE int BKE_pbvh_face_to_index(PBVH *pbvh, PBVHFaceRef f)
{
return (BKE_pbvh_type(pbvh) == PBVH_BMESH && f.i != PBVH_REF_NONE ?
BM_elem_index_get((BMFace *)(f.i)) :
(f.i));
}
BLI_INLINE PBVHFaceRef BKE_pbvh_index_to_face(PBVH *pbvh, int index)
{
switch (BKE_pbvh_type(pbvh)) {
case PBVH_FACES:
case PBVH_GRIDS:
return BKE_pbvh_make_fref(index);
case PBVH_BMESH:
return BKE_pbvh_make_fref((intptr_t)BKE_pbvh_get_bmesh(pbvh)->ftable[index]);
}
return BKE_pbvh_make_fref(PBVH_REF_NONE);
}
/* Callbacks */
/**

View File

@@ -1886,4 +1886,3 @@ int SCULPT_vertex_island_get(const SculptSession *ss, PBVHVertRef vertex);
/* Make SCULPT_ alias to a few blenkernel sculpt methods. */
#define SCULPT_vertex_attr_get BKE_sculpt_vertex_attr_get
#define SCULPT_face_attr_get BKE_sculpt_face_attr_get

View File

@@ -159,7 +159,6 @@ struct SculptUndoStep {
};
static UndoSculpt *get_nodes();
static bool sculpt_attribute_ref_equals(SculptAttrRef *a, SculptAttrRef *b);
static void sculpt_save_active_attribute(Object *ob, SculptAttrRef *attr);
static UndoSculpt *sculpt_undosys_step_get_nodes(UndoStep *us_p);
@@ -1589,11 +1588,6 @@ Node *push_node(Object *ob, PBVHNode *node, Type type)
return unode;
}
static bool sculpt_attribute_ref_equals(SculptAttrRef *a, SculptAttrRef *b)
{
return a->domain == b->domain && a->type == b->type && STREQ(a->name, b->name);
}
static void sculpt_save_active_attribute(Object *ob, SculptAttrRef *attr)
{
Mesh *mesh = BKE_object_get_original_mesh(ob);