Sculpt: Face iterator API
This patch adds basic face iterators to the sculpt API. The interface is similar to the existing vertex iterators. It's not C++ (though it does mark private fields in PBVHFaceIter as private if compiling under C++). Example: ``` PBVHFaceIter fd; BKE_pbvh_face_iter_begin(pbvh, node, fd) { /* Face reference and face index */ PBVHFaceRef face = fd->face; int face_index = fd->index; /* Can read and modify hide flag if it exist (it may not) */ if (fd->hide) { *fd->hide ^= true; /* toggle hide */ } /* Can read and modify face set if it exists */ if (fd->face_set) { *fd->face_set = something; } /*Can read vertices*/ for (int i=0; i<fd.verts_num; i++) { float *co = SCULPT_vertex_co_get(ss, fd.verts[i]); } } BKE_pbvh_face_iter_end(fd); ``` Reviewed By: Brecht Von Lommen and Hans Goudey Differential Revision: https://developer.blender.org/D16225 Ref D16225
This commit is contained in:
@@ -162,6 +162,7 @@ PenaltyBreakString: 1000000
|
||||
ForEachMacros:
|
||||
- BEGIN_ANIMFILTER_SUBCHANNELS
|
||||
- BKE_pbvh_vertex_iter_begin
|
||||
- BKE_pbvh_face_iter_begin
|
||||
- BLI_FOREACH_SPARSE_RANGE
|
||||
- BLI_SMALLSTACK_ITER_BEGIN
|
||||
- BMO_ITER
|
||||
|
Reference in New Issue
Block a user