Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/attribute.cc
| Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | bool BKE_id_attribute_rename(ID *id, | ||||
| } | } | ||||
| CustomData *customdata = attribute_customdata_find(id, layer); | CustomData *customdata = attribute_customdata_find(id, layer); | ||||
| if (customdata == nullptr) { | if (customdata == nullptr) { | ||||
| BKE_report(reports, RPT_ERROR, "Attribute is not part of this geometry"); | BKE_report(reports, RPT_ERROR, "Attribute is not part of this geometry"); | ||||
| return false; | return false; | ||||
| } | } | ||||
| BLI_strncpy_utf8(layer->name, new_name, sizeof(layer->name)); | CustomData_set_layer_name_index(customdata, layer - customdata->layers, new_name); | ||||
| CustomData_set_layer_unique_name(customdata, layer - customdata->layers); | |||||
| return true; | return true; | ||||
| } | } | ||||
| struct AttrUniqueData { | struct AttrUniqueData { | ||||
| ID *id; | ID *id; | ||||
| }; | }; | ||||
| static bool unique_name_cb(void *arg, const char *name) | static bool unique_name_cb(void *arg, const char *name) | ||||
| ▲ Show 20 Lines • Show All 586 Lines • Show Last 20 Lines | |||||