Blender Git Commit Log

Git Commits -> Revision f482afa

October 25, 2020, 07:32 (GMT)
Refactored sculpt code to use a new type, SculptVertRef, that replaces
much of the usage of integer indices. Meshes and grids simply store the
index here, but bmesh stores a pointer to a BMVert. This greatly speeds
up DynTopo by reducing the need to maintain flat pointer arrays in bmesh.

To prevent the accidental casting of ScuptVertexRef to indices and vice
versa SculptVertRef is defined as a struct:

typedef struct {intptr_t i} SculptVertRef;

There are also two functions to convert flat index indices to
SculptVertRefs and back:

ScultpVertRef BKE_pbvh_table_index_to_vertex(PBVH *pbvh, int index);
int BKE_pbvh_vertex_index_to_table(PBVH *pbvh, SculptVertRef *ref);

Note that these functions require the aforementioned maintanance of
flat pointer arrays in bmesh, so make sure to call
SCULPT_ensure_vertex_random_access().

Commit Details:

Full Hash: f482afadabeeba8cfc9ee00929a17dfb3d1f1789
Parent Commit: 661dcd8
Lines Changed: +717, -495

25 Modified Paths:

/source/blender/blenkernel/BKE_paint.h (+9, -6) (Diff)
/source/blender/blenkernel/BKE_pbvh.h (+16, -5) (Diff)
/source/blender/blenkernel/intern/pbvh.c (+17, -14) (Diff)
/source/blender/blenkernel/intern/pbvh_bmesh.c (+45, -24) (Diff)
/source/blender/blenlib/BLI_ghash.h (+2, -2) (Diff)
/source/blender/blenlib/intern/BLI_ghash_utils.c (+11, -4) (Diff)
/source/blender/editors/sculpt_paint/paint_cursor.c (+3, -3) (Diff)
/source/blender/editors/sculpt_paint/paint_hide.c (+9, -11) (Diff)
/source/blender/editors/sculpt_paint/paint_mask.c (+3, -3) (Diff)
/source/blender/editors/sculpt_paint/sculpt.c (+226, -183) (Diff)
/source/blender/editors/sculpt_paint/sculpt_automasking.c (+19, -10) (Diff)
/source/blender/editors/sculpt_paint/sculpt_boundary.c (+135, -85) (Diff)
/source/blender/editors/sculpt_paint/sculpt_cloth.c (+38, -24) (Diff)
/source/blender/editors/sculpt_paint/sculpt_detail.c (+2, -2) (Diff)
/source/blender/editors/sculpt_paint/sculpt_face_set.c (+22, -12) (Diff)
/source/blender/editors/sculpt_paint/sculpt_filter_color.c (+2, -2) (Diff)
/source/blender/editors/sculpt_paint/sculpt_filter_mask.c (+8, -6) (Diff)
/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c (+22, -15) (Diff)
/source/blender/editors/sculpt_paint/sculpt_intern.h (+10, -4) (Diff)
/source/blender/editors/sculpt_paint/sculpt_mask_expand.c (+17, -9) (Diff)
/source/blender/editors/sculpt_paint/sculpt_multiplane_scrape.c (+2, -2) (Diff)
/source/blender/editors/sculpt_paint/sculpt_paint_color.c (+10, -8) (Diff)
/source/blender/editors/sculpt_paint/sculpt_pose.c (+51, -37) (Diff)
/source/blender/editors/sculpt_paint/sculpt_smooth.c (+34, -22) (Diff)
/source/blender/editors/sculpt_paint/sculpt_undo.c (+4, -2) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021