diff options
Diffstat (limited to 'release/scripts/startup/bl_ui')
6 files changed, 94 insertions, 104 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index 8e5f6dba1ab..929953dd411 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -135,19 +135,6 @@ class MESH_UL_uvmaps(UIList): layout.alignment = 'CENTER' layout.label(text="", icon_value=icon) - -class MESH_UL_vcols(UIList): - def draw_item(self, _context, layout, _data, item, icon, _active_data, _active_propname, _index): - # assert(isinstance(item, (bpy.types.MeshTexturePolyLayer, bpy.types.MeshLoopColorLayer))) - if self.layout_type in {'DEFAULT', 'COMPACT'}: - layout.prop(item, "name", text="", emboss=False, icon='GROUP_VCOL') - icon = 'RESTRICT_RENDER_OFF' if item.active_render else 'RESTRICT_RENDER_ON' - layout.prop(item, "active_render", text="", icon=icon, emboss=False) - elif self.layout_type == 'GRID': - layout.alignment = 'CENTER' - layout.label(text="", icon_value=icon) - - class MeshButtonsPanel: bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' @@ -433,64 +420,6 @@ class DATA_PT_uv_texture(MeshButtonsPanel, Panel): col.operator("mesh.uv_texture_add", icon='ADD', text="") col.operator("mesh.uv_texture_remove", icon='REMOVE', text="") - -class DATA_PT_vertex_colors(MeshButtonsPanel, Panel): - bl_label = "Vertex Colors" - bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} - - def draw(self, context): - layout = self.layout - - me = context.mesh - - row = layout.row() - col = row.column() - - col.template_list("MESH_UL_vcols", "vcols", me, "vertex_colors", me.vertex_colors, "active_index", rows=2) - - col = row.column(align=True) - col.operator("mesh.vertex_color_add", icon='ADD', text="") - col.operator("mesh.vertex_color_remove", icon='REMOVE', text="") - - -class DATA_PT_sculpt_vertex_colors(MeshButtonsPanel, Panel): - bl_label = "Sculpt Vertex Colors" - bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} - - @classmethod - def poll(cls, context): - return super().poll(context) and context.preferences.experimental.use_sculpt_vertex_colors - - def draw(self, context): - layout = self.layout - - me = context.mesh - - row = layout.row() - col = row.column() - - col.template_list( - "MESH_UL_vcols", - "svcols", - me, - "sculpt_vertex_colors", - me.sculpt_vertex_colors, - "active_index", - rows=2, - ) - - col = row.column(align=True) - col.operator("mesh.sculpt_vertex_color_add", icon='ADD', text="") - col.operator("mesh.sculpt_vertex_color_remove", icon='REMOVE', text="") - - row = layout.row() - col = row.column() - col.operator("sculpt.vertex_to_loop_colors", text="Store Sculpt Vertex Color") - col.operator("sculpt.loop_to_vertex_colors", text="Load Sculpt Vertex Color") - - class DATA_PT_remesh(MeshButtonsPanel, Panel): bl_label = "Remesh" bl_options = {'DEFAULT_CLOSED'} @@ -514,8 +443,7 @@ class DATA_PT_remesh(MeshButtonsPanel, Panel): col.prop(mesh, "use_remesh_preserve_volume", text="Volume") col.prop(mesh, "use_remesh_preserve_paint_mask", text="Paint Mask") col.prop(mesh, "use_remesh_preserve_sculpt_face_sets", text="Face Sets") - if context.preferences.experimental.use_sculpt_vertex_colors: - col.prop(mesh, "use_remesh_preserve_vertex_colors", text="Vertex Colors") + col.prop(mesh, "use_remesh_preserve_vertex_colors", text="Color Attributes") col.operator("object.voxel_remesh", text="Voxel Remesh") else: @@ -645,6 +573,79 @@ class DATA_PT_mesh_attributes(MeshButtonsPanel, Panel): layout.label(text="Name collisions: {}".format(", ".join(colliding_names)), icon='ERROR') +class MESH_UL_color_attributes(UIList): + display_domain_names = { + 'POINT': "Vertex", + 'EDGE': "Edge", + 'FACE': "Face", + 'CORNER': "Face Corner", + } + + def filter_items(self, context, data, property): + attrs = getattr(data, property) + ret = [] + idxs = [] + + for idx, item in enumerate(attrs): + skip = item.domain not in {"POINT", "CORNER"} + skip = skip or item.data_type not in {"FLOAT_COLOR", "BYTE_COLOR"} + + ret.append(self.bitflag_filter_item if not skip else 0) + idxs.append(idx) + + return ret, idxs + + def draw_item(self, _context, layout, data, attribute, _icon, _active_data, _active_propname, _index): + data_type = attribute.bl_rna.properties['data_type'].enum_items[attribute.data_type] + + domain_name = self.display_domain_names.get(attribute.domain, "") + + split = layout.split(factor=0.50) + split.emboss = 'NONE' + split.prop(attribute, "name", text="") + + active_render = _index == data.color_attributes.render_color_index + + props = split.operator("geometry.color_attribute_render_set", text="", icon = 'RESTRICT_RENDER_OFF'if \ + active_render else 'RESTRICT_RENDER_ON' + ) + + props.name = attribute.name + + sub = split.row() + sub.alignment = 'RIGHT' + sub.active = False + sub.label(text="%s ▶ %s" % (domain_name, data_type.name)) + + +class DATA_PT_vertex_colors(DATA_PT_mesh_attributes, Panel): + bl_label = "Color Attributes" + bl_options = {'DEFAULT_CLOSED'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + + def draw(self, context): + mesh = context.mesh + + layout = self.layout + row = layout.row() + + col = row.column() + col.template_list( + "MESH_UL_color_attributes", + "color_attributes", + mesh, + "color_attributes", + mesh.color_attributes, + "active_color_index", + rows=3, + ) + + col = row.column(align=True) + col.operator("geometry.color_attribute_add", icon='ADD', text="") + col.operator("geometry.color_attribute_remove", icon='REMOVE', text="") + + self.draw_attribute_warnings(context, layout) + classes = ( MESH_MT_vertex_group_context_menu, MESH_MT_shape_key_context_menu, @@ -653,14 +654,12 @@ classes = ( MESH_UL_fmaps, MESH_UL_shape_keys, MESH_UL_uvmaps, - MESH_UL_vcols, MESH_UL_attributes, DATA_PT_context_mesh, DATA_PT_vertex_groups, DATA_PT_shape_keys, DATA_PT_uv_texture, DATA_PT_vertex_colors, - DATA_PT_sculpt_vertex_colors, DATA_PT_face_maps, DATA_PT_mesh_attributes, DATA_PT_normals, @@ -668,6 +667,7 @@ classes = ( DATA_PT_remesh, DATA_PT_customdata, DATA_PT_custom_props_mesh, + MESH_UL_color_attributes, ) if __name__ == "__main__": # only for live edit. diff --git a/release/scripts/startup/bl_ui/properties_material_gpencil.py b/release/scripts/startup/bl_ui/properties_material_gpencil.py index 35b061ecb21..47c61984cbe 100644 --- a/release/scripts/startup/bl_ui/properties_material_gpencil.py +++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py @@ -30,8 +30,8 @@ class GPENCIL_MT_material_context_menu(Menu): layout.separator() - layout.operator("gpencil.material_to_vertex_color", text="Convert Materials to Vertex Color") - layout.operator("gpencil.extract_palette_vertex", text="Extract Palette from Vertex Color") + layout.operator("gpencil.material_to_vertex_color", text="Convert Materials to Color Attribute") + layout.operator("gpencil.extract_palette_vertex", text="Extract Palette from Color Attribute") layout.separator() diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index fc621c5b51e..b8d30f06193 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -1310,8 +1310,6 @@ class _defs_sculpt: exclude_filter = {} # Use 'bpy.context' instead of 'context' since it can be None. prefs = bpy.context.preferences - if not prefs.experimental.use_sculpt_vertex_colors: - exclude_filter = {'PAINT', 'SMEAR'} return generate_from_enum_ex( context, @@ -2954,24 +2952,11 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel): _defs_sculpt.trim_lasso, ), _defs_sculpt.project_line, + _defs_sculpt.mask_by_color, None, _defs_sculpt.mesh_filter, _defs_sculpt.cloth_filter, - lambda context: ( - (_defs_sculpt.color_filter,) - if context is None or ( - context.preferences.view.show_developer_ui and - context.preferences.experimental.use_sculpt_vertex_colors) - else () - ), - None, - lambda context: ( - (_defs_sculpt.mask_by_color,) - if context is None or ( - context.preferences.view.show_developer_ui and - context.preferences.experimental.use_sculpt_vertex_colors) - else () - ), + _defs_sculpt.color_filter, None, _defs_sculpt.face_set_edit, None, diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index b72abeed394..035c4fd1352 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -2259,7 +2259,6 @@ class USERPREF_PT_experimental_new_features(ExperimentalPanel, Panel): def draw(self, context): self._draw_items( context, ( - ({"property": "use_sculpt_vertex_colors"}, "T71947"), ({"property": "use_sculpt_tools_tilt"}, "T82877"), ({"property": "use_sculpt_texture_paint"}, "T96225"), ({"property": "use_extended_asset_browser"}, ("project/view/130/", "Project Page")), diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index b786f5adf33..41c1f3d0683 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -219,6 +219,14 @@ class _draw_tool_settings_context_mode: ups = tool_settings.unified_paint_settings + if capabilities.has_color: + row = layout.row(align=True) + row.ui_units_x = 4 + UnifiedPaintPanel.prop_unified_color(row, context, brush, "color", text="") + UnifiedPaintPanel.prop_unified_color(row, context, brush, "secondary_color", text="") + row.separator() + layout.prop(brush, "blend", text="", expand=False) + size = "size" size_owner = ups if ups.use_unified_size else brush if size_owner.use_locked_size == 'SCENE': @@ -253,10 +261,6 @@ class _draw_tool_settings_context_mode: if not capabilities.has_direction: layout.row().prop(brush, "direction", expand=True, text="") - if capabilities.has_color: - UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="") - layout.prop(brush, "blend", text="", expand=False) - return True @staticmethod @@ -1874,7 +1878,7 @@ class VIEW3D_MT_paint_gpencil(Menu): def draw(self, _context): layout = self.layout - layout.operator("gpencil.vertex_color_set", text="Set Vertex Colors") + layout.operator("gpencil.vertex_color_set", text="Set Color Attribute") layout.operator("gpencil.stroke_reset_vertex_color") layout.separator() layout.operator("gpencil.vertex_color_invert", text="Invert") @@ -1907,7 +1911,7 @@ class VIEW3D_MT_select_gpencil(Menu): layout.operator_menu_enum("gpencil.select_grouped", "type", text="Grouped") if context.mode == 'VERTEX_GPENCIL': - layout.operator("gpencil.select_vertex_color", text="Vertex Color") + layout.operator("gpencil.select_vertex_color", text="Color Attribute") layout.separator() @@ -7572,7 +7576,7 @@ class TOPBAR_PT_gpencil_materials(GreasePencilMaterialsPanel, Panel): class TOPBAR_PT_gpencil_vertexcolor(GreasePencilVertexcolorPanel, Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'HEADER' - bl_label = "Vertex Color" + bl_label = "Color Attribute" bl_ui_units_x = 10 @classmethod diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index df07fbb3198..750e9b527f0 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -419,6 +419,9 @@ class VIEW3D_PT_tools_brush_color(Panel, View3DPaintPanel): elif context.vertex_paint_object: capabilities = brush.vertex_paint_capabilities return capabilities.has_color + elif context.sculpt_object: + capabilities = brush.sculpt_capabilities + return capabilities.has_color return False @@ -864,8 +867,7 @@ class VIEW3D_PT_sculpt_voxel_remesh(Panel, View3DPaintPanel): col.prop(mesh, "use_remesh_preserve_volume", text="Volume") col.prop(mesh, "use_remesh_preserve_paint_mask", text="Paint Mask") col.prop(mesh, "use_remesh_preserve_sculpt_face_sets", text="Face Sets") - if context.preferences.experimental.use_sculpt_vertex_colors: - col.prop(mesh, "use_remesh_preserve_vertex_colors", text="Vertex Colors") + col.prop(mesh, "use_remesh_preserve_vertex_colors", text="Color Attributes") layout.operator("object.voxel_remesh", text="Remesh") |