[Bf-blender-cvs] [1203bd58bef] master: Fix: Make renaming attributes check uniqueness on all domains

Martijn Versteegh noreply at git.blender.org
Tue Jun 7 14:52:49 CEST 2022


Commit: 1203bd58beffbfd517818521750cdc3f1d273cd2
Author: Martijn Versteegh
Date:   Tue Jun 7 14:51:52 2022 +0200
Branches: master
https://developer.blender.org/rB1203bd58beffbfd517818521750cdc3f1d273cd2

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

===================================================================

M	source/blender/blenkernel/intern/attribute.cc

===================================================================

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



More information about the Bf-blender-cvs mailing list