diff options
author | Martijn Versteegh <Baardaap> | 2022-06-07 15:51:52 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-06-07 15:52:27 +0300 |
commit | 1203bd58beffbfd517818521750cdc3f1d273cd2 (patch) | |
tree | da3bc42f889d19b07c9491971bb6172cfa35e48a /source/blender/blenkernel/intern/attribute.cc | |
parent | 503bcaf1a2cd2bfd5d66494dd52a0a91472ee8ea (diff) |
Fix: Make renaming attributes check uniqueness on all domains
This function only checked for uniqueness in the current domain,
while attribute names should be unique among all domains within
a geometry.
Differential Revision: https://developer.blender.org/D15144
Diffstat (limited to 'source/blender/blenkernel/intern/attribute.cc')
-rw-r--r-- | source/blender/blenkernel/intern/attribute.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/attribute.cc b/source/blender/blenkernel/intern/attribute.cc index fedcfc5c721..4dd25ba1292 100644 --- a/source/blender/blenkernel/intern/attribute.cc +++ b/source/blender/blenkernel/intern/attribute.cc @@ -138,8 +138,10 @@ bool BKE_id_attribute_rename(ID *id, return false; } - BLI_strncpy_utf8(layer->name, new_name, sizeof(layer->name)); - CustomData_set_layer_unique_name(customdata, layer - customdata->layers); + char result_name[MAX_CUSTOMDATA_LAYER_NAME]; + BKE_id_attribute_calc_unique_name(id, new_name, result_name); + BLI_strncpy_utf8(layer->name, result_name, sizeof(layer->name)); + return true; } |