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/editors/sculpt_paint/sculpt_face_set.cc | |
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/editors/sculpt_paint/sculpt_face_set.cc')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_face_set.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_face_set.cc b/source/blender/editors/sculpt_paint/sculpt_face_set.cc index 485375a5cb1..fce4aa31b5d 100644 --- a/source/blender/editors/sculpt_paint/sculpt_face_set.cc +++ b/source/blender/editors/sculpt_paint/sculpt_face_set.cc @@ -66,7 +66,7 @@ int ED_sculpt_face_sets_find_next_available_id(struct Mesh *mesh) { const int *face_sets = static_cast<const int *>( - CustomData_get_layer(&mesh->pdata, CD_SCULPT_FACE_SETS)); + CustomData_get_layer_named(&mesh->pdata, CD_PROP_INT32, ".sculpt_face_set")); if (!face_sets) { return SCULPT_FACE_SET_NONE; } @@ -82,7 +82,8 @@ int ED_sculpt_face_sets_find_next_available_id(struct Mesh *mesh) void ED_sculpt_face_sets_initialize_none_to_id(struct Mesh *mesh, const int new_id) { - int *face_sets = static_cast<int *>(CustomData_get_layer(&mesh->pdata, CD_SCULPT_FACE_SETS)); + int *face_sets = static_cast<int *>( + CustomData_get_layer_named(&mesh->pdata, CD_PROP_INT32, ".sculpt_face_set")); if (!face_sets) { return; } |