Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-08-02 22:43:36 +0300
committerHans Goudey <h.goudey@me.com>2022-08-02 22:43:36 +0300
commitc5b361335aaa1552627d3c217251461eb5f384a5 (patch)
tree3d1f2ff759384620de136e536184c62802b0488c /source/blender/makesrna
parent44aa9e40ffe40c0b222c2f4675545a5777e27059 (diff)
Cleanup: Simplify functions for adding and removing color attributes
The specific functions for vertex colors and and sculpt vertex colors can be replaced by more generic attribute functions internally. Also remove a paramter from one function.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 65468977ccb..9aef19c8230 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -1608,9 +1608,7 @@ static void rna_Mesh_vertex_color_remove(struct Mesh *me,
ReportList *reports,
CustomDataLayer *layer)
{
- if (ED_mesh_color_remove_named(me, layer->name) == false) {
- BKE_reportf(reports, RPT_ERROR, "Vertex color '%s' not found", layer->name);
- }
+ BKE_id_attribute_remove(&me->id, layer->name, reports);
}
static PointerRNA rna_Mesh_sculpt_vertex_color_new(struct Mesh *me,
@@ -1621,7 +1619,7 @@ static PointerRNA rna_Mesh_sculpt_vertex_color_new(struct Mesh *me,
PointerRNA ptr;
CustomData *vdata;
CustomDataLayer *cdl = NULL;
- int index = ED_mesh_sculpt_color_add(me, name, false, do_init, reports);
+ int index = ED_mesh_sculpt_color_add(me, name, do_init, reports);
if (index != -1) {
vdata = rna_mesh_vdata_helper(me);
@@ -1636,9 +1634,7 @@ static void rna_Mesh_sculpt_vertex_color_remove(struct Mesh *me,
ReportList *reports,
CustomDataLayer *layer)
{
- if (ED_mesh_sculpt_color_remove_named(me, layer->name) == false) {
- BKE_reportf(reports, RPT_ERROR, "Sculpt vertex color '%s' not found", layer->name);
- }
+ BKE_id_attribute_remove(&me->id, layer->name, reports);
}
# define DEFINE_CUSTOMDATA_PROPERTY_API( \