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:
authorDennis Ranish <Codec>2022-06-08 22:10:32 +0300
committerJoseph Eagar <joeedh@gmail.com>2022-06-08 22:10:32 +0300
commit9c28f0eb37aebd6e5eae0763b008ef02d5ce081b (patch)
tree65bc5d816ffc13a30ebf9aa454dd6fee7f512ed1 /release/scripts/startup/bl_ui/properties_data_mesh.py
parentf69c565a33ca58bb95a2bd22de0e211799508182 (diff)
D14823: Adds operator to duplicate the active color attribute layer
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
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_data_mesh.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_data_mesh.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py
index 15d25f71419..764299e7ce3 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -64,6 +64,18 @@ class MESH_MT_shape_key_context_menu(Menu):
layout.operator("object.shape_key_move", icon='TRIA_DOWN_BAR', text="Move to Bottom").type = 'BOTTOM'
+class MESH_MT_color_attribute_context_menu(Menu):
+ bl_label = "Color Attribute Specials"
+
+ def draw(self, _context):
+ layout = self.layout
+
+ props = layout.operator(
+ "geometry.color_attribute_duplicate",
+ icon='DUPLICATE',
+ )
+
+
class MESH_MT_attribute_context_menu(Menu):
bl_label = "Attribute Specials"
@@ -660,12 +672,16 @@ class DATA_PT_vertex_colors(DATA_PT_mesh_attributes, Panel):
col.operator("geometry.color_attribute_add", icon='ADD', text="")
col.operator("geometry.color_attribute_remove", icon='REMOVE', text="")
- self.draw_attribute_warnings(context, layout)
+ col.separator()
+ col.menu("MESH_MT_color_attribute_context_menu", icon='DOWNARROW_HLT', text="")
+
+ self.draw_attribute_warnings(context, layout)
classes = (
MESH_MT_vertex_group_context_menu,
MESH_MT_shape_key_context_menu,
+ MESH_MT_color_attribute_context_menu,
MESH_MT_attribute_context_menu,
MESH_UL_vgroups,
MESH_UL_fmaps,