diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-23 16:19:40 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-23 16:19:40 +0300 |
commit | 060a5341419412fd7996cf99a56db1f581a4c30c (patch) | |
tree | 59413121aaf62bedc794822ea8d1c4d2c55e9088 /source/blender/blenkernel/intern/pbvh.c | |
parent | 35375380d73b93999b879164fd59266ee044472c (diff) |
Mesh: Move sculpt face sets to a generic attribute
Similar to the other refactors from T95965, this commit moves sculpt
face sets to use a generic integer attribute named `".sculpt_face_set"`.
This makes face sets accessible in the Python API.
The attribute is not visible in the attributes list or the spreadsheet
because it is meant for internal use, though that could be an option
in the future along with other similar attributes. Currently the change
is small, but in the future this could simplify code by allowing use
of more generic attribute APIs.
Differential Revision: https://developer.blender.org/D16045
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh.c')
-rw-r--r-- | source/blender/blenkernel/intern/pbvh.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index 2bed18de6cf..aad19a8b842 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -1326,16 +1326,17 @@ static void pbvh_update_draw_buffer_cb(void *__restrict userdata, case PBVH_FACES: { /* Pass vertices separately because they may be not be the same as the mesh's vertices, * and pass normals separately because they are managed by the PBVH. */ - GPU_pbvh_mesh_buffers_update(pbvh->vbo_id, - node->draw_buffers, - pbvh->mesh, - pbvh->verts, - CustomData_get_layer(pbvh->vdata, CD_PAINT_MASK), - CustomData_get_layer(pbvh->pdata, CD_SCULPT_FACE_SETS), - pbvh->face_sets_color_seed, - pbvh->face_sets_color_default, - update_flags, - pbvh->vert_normals); + GPU_pbvh_mesh_buffers_update( + pbvh->vbo_id, + node->draw_buffers, + pbvh->mesh, + pbvh->verts, + CustomData_get_layer(pbvh->vdata, CD_PAINT_MASK), + CustomData_get_layer_named(pbvh->pdata, CD_PROP_INT32, ".sculpt_face_set"), + pbvh->face_sets_color_seed, + pbvh->face_sets_color_default, + update_flags, + pbvh->vert_normals); break; } case PBVH_BMESH: @@ -3135,9 +3136,9 @@ bool pbvh_has_face_sets(PBVH *pbvh) { switch (pbvh->header.type) { case PBVH_GRIDS: - return (pbvh->pdata && CustomData_get_layer(pbvh->pdata, CD_SCULPT_FACE_SETS)); case PBVH_FACES: - return (pbvh->pdata && CustomData_get_layer(pbvh->pdata, CD_SCULPT_FACE_SETS)); + return pbvh->pdata && + CustomData_get_layer_named(pbvh->pdata, CD_PROP_INT32, ".sculpt_face_set") != NULL; case PBVH_BMESH: return false; } |