diff options
author | Hans Goudey <h.goudey@me.com> | 2022-08-23 17:44:02 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-08-23 17:44:10 +0300 |
commit | b649fc13ed47a80e9b06b83cd76c6f9ab73154bc (patch) | |
tree | a20e16d3aca95e1fb552e5018102e92a998d612d /source/blender/editors/sculpt_paint/sculpt_undo.c | |
parent | c32bb58e5b44421cb2450b10a475e25b6c15135e (diff) |
Cleanup: Avoid using invalid attribute domain
The number of attribute domains isn't an attribute domain, so storing
ATTR_DOMAIN_NUM in a variable with an eAttrDomain type isn't correct.
In the cases it was used, the value wouldn't be accessed anyway.
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_undo.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index 283e9a1c6fa..9a445359c4e 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -1669,11 +1669,12 @@ static void sculpt_undo_set_active_layer(struct bContext *C, SculptAttrRef *attr */ if (!layer) { layer = BKE_id_attribute_search(&me->id, attr->name, CD_MASK_PROP_ALL, ATTR_DOMAIN_MASK_ALL); - eAttrDomain domain = layer ? BKE_id_attribute_domain(&me->id, layer) : ATTR_DOMAIN_NUM; - - if (layer && ED_geometry_attribute_convert( - me, attr->name, layer->type, domain, attr->type, attr->domain)) { - layer = BKE_id_attribute_find(&me->id, attr->name, attr->type, attr->domain); + if (layer) { + const eAttrDomain domain = BKE_id_attribute_domain(&me->id, layer); + if (ED_geometry_attribute_convert( + me, attr->name, layer->type, domain, attr->type, attr->domain)) { + layer = BKE_id_attribute_find(&me->id, attr->name, attr->type, attr->domain); + } } } |