diff options
author | Jacques Lucke <jacques@blender.org> | 2022-01-21 14:47:35 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-01-21 14:47:35 +0300 |
commit | f6888b530ac81abbe61755971449ad6b42b93c82 (patch) | |
tree | d5234ec992f73046f031e71d62cc47efe5cbcc64 /release | |
parent | 36c40760a5a38db733e20c948b2170ab78bb2607 (diff) |
Attributes: add operator to convert generic attributes to other types
Editing of generic attributes on the original objects in edit modes is
still very limited. However, when applying a geometry nodes modifier
that generates new attributes. These attributes will show up in the
Attributes panel.
Currently, our exporters are not capable of exporting generic attributes.
Therefore, for the time being, a work around is to apply geometry nodes
and then convert a generic attribute to a task specific attribute like a
uv map, vertex group or vertex color layer. Once more parts of Blender
support generic attributes, this will become less important.
Currently, only meshes are supported by the operator. However, it would
be relatively easy to extend it to other geometry types.
Differential Revision: https://developer.blender.org/D13838
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_mesh.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index 49f196640d8..11e2cd84903 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -82,6 +82,14 @@ class MESH_MT_shape_key_context_menu(Menu): layout.operator("object.shape_key_move", icon='TRIA_UP_BAR', text="Move to Top").type = 'TOP' layout.operator("object.shape_key_move", icon='TRIA_DOWN_BAR', text="Move to Bottom").type = 'BOTTOM' +class MESH_MT_attribute_context_menu(Menu): + bl_label = "Attribute Specials" + + def draw(self, context): + layout = self.layout + + layout.operator("geometry.attribute_convert") + class MESH_UL_vgroups(UIList): def draw_item(self, _context, layout, _data, item, icon, _active_data_, _active_propname, _index): @@ -615,6 +623,10 @@ class DATA_PT_mesh_attributes(MeshButtonsPanel, Panel): col.operator("geometry.attribute_add", icon='ADD', text="") col.operator("geometry.attribute_remove", icon='REMOVE', text="") + col.separator() + + col.menu("MESH_MT_attribute_context_menu", icon='DOWNARROW_HLT', text="") + self.draw_attribute_warnings(context, layout) def draw_attribute_warnings(self, context, layout): @@ -652,6 +664,7 @@ class DATA_PT_mesh_attributes(MeshButtonsPanel, Panel): classes = ( MESH_MT_vertex_group_context_menu, MESH_MT_shape_key_context_menu, + MESH_MT_attribute_context_menu, MESH_UL_vgroups, MESH_UL_fmaps, MESH_UL_shape_keys, |