Fixes T97706 Adds operator to duplicate the active color attribute layer. Adds `"Color Attribute Specials"` menu to color attribute ui to access the `"geometry.color_attribute_duplicate"` operator. Internally adds a function that duplicates a referenced CustomDataLayer - `BKE_id_attribute_duplicate` mostly copies the existing `BKE_id_attribute_new` - but gets the type and domain from the referenced layer - and copies the data from the old layer into the new layer Reviewed By: Joseph Eagar & Hans Goudey & Julien Kaspar Differential Revision: https://developer.blender.org/D14823 Ref D14823
28 lines
805 B
C++
28 lines
805 B
C++
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
* Copyright 2020 Blender Foundation. All rights reserved. */
|
|
|
|
/** \file
|
|
* \ingroup edgeometry
|
|
*/
|
|
|
|
#include "WM_api.h"
|
|
|
|
#include "ED_geometry.h"
|
|
|
|
#include "geometry_intern.hh"
|
|
|
|
/**************************** registration **********************************/
|
|
|
|
void ED_operatortypes_geometry(void)
|
|
{
|
|
using namespace blender::ed::geometry;
|
|
|
|
WM_operatortype_append(GEOMETRY_OT_attribute_add);
|
|
WM_operatortype_append(GEOMETRY_OT_attribute_remove);
|
|
WM_operatortype_append(GEOMETRY_OT_color_attribute_add);
|
|
WM_operatortype_append(GEOMETRY_OT_color_attribute_remove);
|
|
WM_operatortype_append(GEOMETRY_OT_color_attribute_render_set);
|
|
WM_operatortype_append(GEOMETRY_OT_color_attribute_duplicate);
|
|
WM_operatortype_append(GEOMETRY_OT_attribute_convert);
|
|
}
|