diff options
author | Hans Goudey <h.goudey@me.com> | 2022-06-14 17:25:24 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-06-14 17:41:43 +0300 |
commit | 58a67e6fb6df527ed45c0a554efd387e770bdc42 (patch) | |
tree | ea4fdb342e7d98a236dd929d2e8fbbbbdcb72e8a /source/blender/editors | |
parent | 3012eca3503779697208f24d9f0a09494cd51455 (diff) |
Attributes: Adjustments to duplicate attribute API function
Use a name argument, for the same reasons as 6eea5f70e3b79e3c668.
Also reuse the layer and unique name creation in `BKE_id_attribute_new`
instead of reimplementing it. Also include a few miscellaneous cleanups
like using const variables and `std::string`.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/geometry/geometry_attributes.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/geometry/geometry_attributes.cc b/source/blender/editors/geometry/geometry_attributes.cc index 1a3bf6a2958..79639097fbe 100644 --- a/source/blender/editors/geometry/geometry_attributes.cc +++ b/source/blender/editors/geometry/geometry_attributes.cc @@ -518,13 +518,13 @@ static int geometry_color_attribute_duplicate_exec(bContext *C, wmOperator *op) { Object *ob = ED_object_context(C); ID *id = static_cast<ID *>(ob->data); - CustomDataLayer *layer = BKE_id_attributes_active_color_get(id); + const CustomDataLayer *layer = BKE_id_attributes_active_color_get(id); if (layer == nullptr) { return OPERATOR_CANCELLED; } - CustomDataLayer *newLayer = BKE_id_attribute_duplicate(id, layer, op->reports); + CustomDataLayer *newLayer = BKE_id_attribute_duplicate(id, layer->name, op->reports); BKE_id_attributes_active_color_set(id, newLayer); |