[Bf-blender-cvs] [1ed1fc0f573] sculpt-dev: sculpt-dev: Rename SculptVertRef -> PBVHVertRef
Joseph Eagar
noreply at git.blender.org
Sat Jul 30 04:33:36 CEST 2022
Commit: 1ed1fc0f573ea6e277ae8163d1a843cd8c6c5e91
Author: Joseph Eagar
Date: Fri Jul 29 19:31:27 2022 -0700
Branches: sculpt-dev
https://developer.blender.org/rB1ed1fc0f573ea6e277ae8163d1a843cd8c6c5e91
sculpt-dev: Rename SculptVertRef -> PBVHVertRef
Should make merging easier.
===================================================================
M source/blender/blenkernel/BKE_paint.h
M source/blender/blenkernel/BKE_pbvh.h
M source/blender/blenkernel/intern/dyntopo.c
M source/blender/blenkernel/intern/paint.c
M source/blender/blenkernel/intern/pbvh.c
M source/blender/blenkernel/intern/pbvh.cc
M source/blender/blenkernel/intern/pbvh_bmesh.c
M source/blender/blenkernel/intern/pbvh_intern.h
M source/blender/editors/sculpt_paint/paint_cursor.c
M source/blender/editors/sculpt_paint/paint_mask.c
M source/blender/editors/sculpt_paint/sculpt.c
M source/blender/editors/sculpt_paint/sculpt.hh
M source/blender/editors/sculpt_paint/sculpt_array.c
M source/blender/editors/sculpt_paint/sculpt_automasking.cc
M source/blender/editors/sculpt_paint/sculpt_boundary.c
M source/blender/editors/sculpt_paint/sculpt_brush_types.c
M source/blender/editors/sculpt_paint/sculpt_cloth.c
M source/blender/editors/sculpt_paint/sculpt_curvature.c
M source/blender/editors/sculpt_paint/sculpt_detail.c
M source/blender/editors/sculpt_paint/sculpt_dyntopo.c
M source/blender/editors/sculpt_paint/sculpt_expand.c
M source/blender/editors/sculpt_paint/sculpt_face_set.c
M source/blender/editors/sculpt_paint/sculpt_face_set_topology.c
M source/blender/editors/sculpt_paint/sculpt_filter_color.c
M source/blender/editors/sculpt_paint/sculpt_filter_mask.c
M source/blender/editors/sculpt_paint/sculpt_filter_mesh.c
M source/blender/editors/sculpt_paint/sculpt_geodesic.c
M source/blender/editors/sculpt_paint/sculpt_intern.h
M source/blender/editors/sculpt_paint/sculpt_mask_expand.c
M source/blender/editors/sculpt_paint/sculpt_ops.c
M source/blender/editors/sculpt_paint/sculpt_paint_image.cc
M source/blender/editors/sculpt_paint/sculpt_poly_loop.c
M source/blender/editors/sculpt_paint/sculpt_pose.c
M source/blender/editors/sculpt_paint/sculpt_smooth.c
M source/blender/editors/sculpt_paint/sculpt_symmetrize.c
M source/blender/editors/sculpt_paint/sculpt_undo.c
===================================================================
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index 8dd03c1d62b..5ec0175d405 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -478,7 +478,7 @@ typedef struct SculptVertexInfo {
typedef struct SculptBoundaryEditInfo {
/* Vertex index from where the topology propagation reached this vertex. */
- SculptVertRef original_vertex;
+ PBVHVertRef original_vertex;
int original_vertex_i;
/* How many steps were needed to reach this vertex from the boundary. */
@@ -490,8 +490,8 @@ typedef struct SculptBoundaryEditInfo {
/* Edge for drawing the boundary preview in the cursor. */
typedef struct SculptBoundaryPreviewEdge {
- SculptVertRef v1;
- SculptVertRef v2;
+ PBVHVertRef v1;
+ PBVHVertRef v2;
} SculptBoundaryPreviewEdge;
#define MAX_STORED_COTANGENTW_EDGES 7
@@ -504,7 +504,7 @@ typedef struct StoredCotangentW {
typedef struct SculptBoundary {
/* Vertex indices of the active boundary. */
- SculptVertRef *vertices;
+ PBVHVertRef *vertices;
int *vertex_indices;
int vertices_capacity;
@@ -520,7 +520,7 @@ typedef struct SculptBoundary {
float (*boundary_tangents)[3];
StoredCotangentW *boundary_cotangents;
- SculptVertRef *boundary_closest;
+ PBVHVertRef *boundary_closest;
int sculpt_totvert;
/* Data for drawing the preview. */
@@ -532,12 +532,12 @@ typedef struct SculptBoundary {
bool forms_loop;
/* Initial vertex in the boundary which is closest to the current sculpt active vertex. */
- SculptVertRef initial_vertex;
+ PBVHVertRef initial_vertex;
/* Vertex that at max_propagation_steps from the boundary and closest to the original active
* vertex that was used to initialize the boundary. This is used as a reference to check how much
* the deformation will go into the mesh and to calculate the strength of the brushes. */
- SculptVertRef pivot_vertex;
+ PBVHVertRef pivot_vertex;
/* Stores the initial positions of the pivot and boundary initial vertex as they may be deformed
* during the brush action. This allows to use them as a reference positions and vectors for some
@@ -632,7 +632,7 @@ typedef struct SculptFakeNeighbors {
float current_max_distance;
/* Indexed by vertex, stores the vertex index of its fake neighbor if available. */
- SculptVertRef *fake_neighbor_index;
+ PBVHVertRef *fake_neighbor_index;
} SculptFakeNeighbors;
@@ -801,8 +801,8 @@ typedef struct SculptSession {
struct ExpandCache *expand_cache;
/* Cursor data and active vertex for tools */
- SculptVertRef active_vertex_index;
- SculptFaceRef active_face_index;
+ PBVHVertRef active_vertex_index;
+ PBVHFaceRef active_face_index;
int active_grid_index;
@@ -832,11 +832,11 @@ typedef struct SculptSession {
/* Face Sets by topology. */
int face_set_last_created;
- SculptFaceRef face_set_last_poly;
- SculptEdgeRef face_set_last_edge;
+ PBVHFaceRef face_set_last_poly;
+ PBVHEdgeRef face_set_last_edge;
/* Dynamic mesh preview */
- SculptVertRef *preview_vert_index_list;
+ PBVHVertRef *preview_vert_index_list;
int preview_vert_index_count;
/* Pose Brush Preview */
diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h
index 8e9afb0648a..e3d026bab8c 100644
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@ -32,23 +32,19 @@ extern "C" {
The idea is to enforce stronger type checking by encapsulating
intptr_t's in structs.*/
-typedef struct SculptElemRef {
+typedef struct PBVHVertRef {
intptr_t i;
-} SculptElemRef;
+} PBVHVertRef;
-typedef struct SculptVertRef {
+typedef struct PBVHEdgeRef {
intptr_t i;
-} SculptVertRef;
+} PBVHEdgeRef;
-typedef struct SculptEdgeRef {
+typedef struct PBVHFaceRef {
intptr_t i;
-} SculptEdgeRef;
+} PBVHFaceRef;
-typedef struct SculptFaceRef {
- intptr_t i;
-} SculptFaceRef;
-
-#define SCULPT_REF_NONE ((intptr_t)-1)
+#define PBVH_REF_NONE ((intptr_t)-1)
typedef struct SculptPMap {
struct MeshElemMap *pmap;
@@ -62,21 +58,21 @@ typedef struct SculptLoopRef {
} SculptLoopRef;
#endif
-BLI_INLINE SculptVertRef BKE_pbvh_make_vref(intptr_t i)
+BLI_INLINE PBVHVertRef BKE_pbvh_make_vref(intptr_t i)
{
- SculptVertRef ret = {i};
+ PBVHVertRef ret = {i};
return ret;
}
-BLI_INLINE SculptEdgeRef BKE_pbvh_make_eref(intptr_t i)
+BLI_INLINE PBVHEdgeRef BKE_pbvh_make_eref(intptr_t i)
{
- SculptEdgeRef ret = {i};
+ PBVHEdgeRef ret = {i};
return ret;
}
-BLI_INLINE SculptFaceRef BKE_pbvh_make_fref(intptr_t i)
+BLI_INLINE PBVHFaceRef BKE_pbvh_make_fref(intptr_t i)
{
- SculptFaceRef ret = {i};
+ PBVHFaceRef ret = {i};
return ret;
}
@@ -90,12 +86,12 @@ typedef struct PBVHTri {
intptr_t l[3]; // loops
float no[3];
- SculptFaceRef f;
+ PBVHFaceRef f;
} PBVHTri;
typedef struct PBVHTriBuf {
PBVHTri *tris;
- SculptVertRef *verts;
+ PBVHVertRef *verts;
int *edges;
int totvert, totedge, tottri;
int verts_size, edges_size, tris_size;
@@ -159,7 +155,7 @@ typedef struct ProxyVertArray {
float (*fno)[3];
short (*no)[3];
float *mask, **ownermask;
- SculptVertRef *index;
+ PBVHVertRef *index;
float **ownercolor, (*color)[4];
ProxyKey (*neighbors)[MAX_PROXY_NEIGHBORS];
@@ -186,7 +182,7 @@ typedef enum {
typedef struct ProxyVertUpdateRec {
float *co, *no, *mask, *color;
- SculptVertRef index, newindex;
+ PBVHVertRef index, newindex;
} ProxyVertUpdateRec;
# define PBVH_PROXY_DEFAULT CO | INDEX | MASK
@@ -203,7 +199,7 @@ void BKE_pbvh_ensure_proxyarray(
struct PBVHNode *node,
int mask,
struct GHash
- *vert_node_map, // vert_node_map maps vertex SculptVertRefs to PBVHNode indices; optional
+ *vert_node_map, // vert_node_map maps vertex PBVHVertRefs to PBVHNode indices; optional
bool check_indexmap,
bool force_update);
void BKE_pbvh_gather_proxyarray(PBVH *pbvh, PBVHNode **nodes, int totnode);
@@ -357,7 +353,7 @@ void BKE_pbvh_update_sculpt_verts(PBVH *pbvh);
/** update original data, only data whose r_** parameters are passed in will be updated*/
bool BKE_pbvh_get_origvert(
- PBVH *pbvh, SculptVertRef vertex, const float **r_co, float **r_no, float **r_color);
+ PBVH *pbvh, PBVHVertRef vertex, const float **r_co, float **r_no, float **r_color);
/**
checks if original data needs to be updated for v, and if so updates it. Stroke_id
@@ -406,8 +402,8 @@ bool BKE_pbvh_node_raycast(PBVH *pbvh,
int *hit_count,
float *depth,
float *back_depth,
- SculptVertRef *active_vertex_index,
- SculptFaceRef *active_face_grid_index,
+ PBVHVertRef *active_vertex_index,
+ PBVHFaceRef *active_face_grid_index,
float *face_normal,
int stroke_id);
@@ -515,7 +511,7 @@ typedef enum {
PBVH_LocalCollapse = 1 << 4
} PBVHTopologyUpdateMode;
-typedef float (*DyntopoMaskCB)(SculptVertRef vertex, void *userdata);
+typedef float (*DyntopoMaskCB)(PBVHVertRef vertex, void *userdata);
bool BKE_pbvh_bmesh_update_topology(
PBVH *pbvh,
@@ -556,11 +552,11 @@ void BKE_pbvh_face_areas_begin(PBVH *pbvh);
// updates boundaries and valences for whole mesh
void BKE_pbvh_bmesh_on_mesh_change(PBVH *pbvh);
-bool BKE_pbvh_bmesh_check_valence(PBVH *pbvh, SculptVertRef vertex);
-void BKE_pbvh_bmesh_update_valence(int cd_sculpt_vert, SculptVertRef vertex);
+bool BKE_pbvh_bmesh_check_valence(PBVH *pbvh, PBVHVertRef vertex);
+void BKE_pbvh_bmesh_update_valence(int cd_sculpt_vert, PBVHVertRef vertex);
void BKE_pbvh_bmesh_update_all_valence(PBVH *pbvh);
void BKE_pbvh_bmesh_flag_all_disk_sort(PBVH *pbvh);
-bool BKE_pbvh_bmesh_mark_update_valence(PBVH *pbvh, SculptVertRef vertex);
+bool BKE_pbvh_bmesh_mark_update_valence(PBVH *pbvh, PBVHVertRef vertex);
/* if pbvh uses a split index buffer, will call BKE_pbvh_node_mark_update_triangulation;
otherwise does nothing. returns true if BKE_pbvh_node_mark_update_triangulation was
@@ -587,7 +583,7 @@ bool BKE_pbvh_node_fully_unmasked_get(PBVHNode *node);
void BKE_pbvh_node_mark_curvature_update(PBVHNode *node);
void BKE_pbvh_mark_rebuild_pixels(PBVH *pbvh);
-void BKE_pbvh_vert_mark_update(PBVH *pbvh, SculptVertRef vertex);
+void BKE_pbvh_vert_mark_update(PBVH *pbvh, PBVHVertRef vertex);
void BKE_pbvh_node_get_grids(PBVH *pbvh,
PBVHNode *node,
@@ -675,7 +671,7 @@ typedef struct PBVHVertexIter {
int gy;
int i;
int index;
- SculptVertRef vertex;
+ PBVHVertRef vertex;
bool respect_hide;
/* grid */
@@ -812,17 +808,17 @@ void pbvh_vertex_iter_init(PBVH *pbvh, PBVHNode *node, PBVHVertexIter *vi, int m
} \
((void)0)
-#define BKE_pbvh_vertex_index_to_table(pbvh, v) \
+#define BKE_pbvh_vertex_to_index(pbvh, v) \
(BKE_pbvh_type(pbvh) == PBVH_BMESH && v.i != -1 ? BM_elem_index_get((BMVert *)(v.i)) : (v.i))
-SculptVertRef BKE_pbvh_table_index_to_vertex(PBVH *pbvh, int idx);
+PBVHVertRef BKE_pbvh_index_to_vertex(PBVH *pbvh, int idx);
-#define BKE_pbvh_edge_index_to_table(pbvh, v) \
+#define BKE_pbvh_edge_to_index(pbvh, v) \
(BKE_pbvh_type(pbvh) == PBVH_BMESH && v.i != -1 ? BM_elem_index_get((BMEdge *)(v.i)) : (v.i))
-SculptEdgeRef BKE_pbvh_table_index_to_edge(PBVH *pbvh, int idx);
+PBVHEdgeRef BKE_pbvh_index_to_edge(PBVH *pbvh, int idx);
-#define BKE_pbvh_face_index_to_table(pbvh, v) \
+#define BKE_pbvh_face_to_index(pbvh, v) \
(BKE_pbvh_type(pbvh) == PBVH_BMESH && v.i != -1 ? BM_elem_index_get((BMFace *)(v.i)) : (v.i))
-SculptFaceRef BKE_pbvh_table_index_to_face(PBVH *pbvh, int idx);
+PBVHFaceRef BKE_pbvh_index_to_face(PBVH *pbvh, int idx);
void BKE_pbvh_node_get_proxies(PBVHNode *node, PBVHProxyNode **proxies, int *proxy_count);
void BKE_pbvh_node_free_proxies(PBVHNode *node);
@@ -886,8 +882,8 @@ void BKE_pbvh_node_num_loops(PBVH *pbvh, PBVHNode *node, int *r_totloop);
void BKE_pbvh_update_active_vcol(PBVH *pbvh, const struct Mesh *mesh);
-void BKE_pbvh_vertex_color_set(PBVH *pbvh, SculptVertRef verte
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list