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
This commit is contained in:
Martijn Versteegh 2022-06-07 14:51:52 +02:00 committed by Hans Goudey
parent 503bcaf1a2
commit 1203bd58be
1 changed files with 4 additions and 2 deletions

View File

@ -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;
}