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:
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_data_mesh.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_data_mesh.py37
1 files changed, 27 insertions, 10 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py
index 80b9b773d9b..a6b97fbdc85 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -3,6 +3,8 @@ import bpy
from bpy.types import Menu, Panel, UIList
from rna_prop_ui import PropertyPanel
+from bpy.app.translations import pgettext_tip as tip_
+
class MESH_MT_vertex_group_context_menu(Menu):
bl_label = "Vertex Group Specials"
@@ -491,13 +493,25 @@ class DATA_PT_customdata(MeshButtonsPanel, Panel):
else:
col.operator("mesh.customdata_custom_splitnormals_add", icon='ADD')
- col = layout.column(heading="Store")
+ if me.has_bevel_weight_edge:
+ col.operator("mesh.customdata_bevel_weight_edge_clear", icon='X')
+ else:
+ col.operator("mesh.customdata_bevel_weight_edge_add", icon='ADD')
+
+ if me.has_bevel_weight_vertex:
+ col.operator("mesh.customdata_bevel_weight_vertex_clear", icon='X')
+ else:
+ col.operator("mesh.customdata_bevel_weight_vertex_add", icon='ADD')
+
+ if me.has_crease_edge:
+ col.operator("mesh.customdata_crease_edge_clear", icon='X')
+ else:
+ col.operator("mesh.customdata_crease_edge_add", icon='ADD')
- col.enabled = obj is not None and obj.mode != 'EDIT'
- col.prop(me, "use_customdata_vertex_bevel", text="Vertex Bevel Weight")
- col.prop(me, "use_customdata_edge_bevel", text="Edge Bevel Weight")
- col.prop(me, "use_customdata_vertex_crease", text="Vertex Crease")
- col.prop(me, "use_customdata_edge_crease", text="Edge Crease")
+ if me.has_crease_vertex:
+ col.operator("mesh.customdata_crease_vertex_clear", icon='X')
+ else:
+ col.operator("mesh.customdata_crease_vertex_add", icon='ADD')
class DATA_PT_custom_props_mesh(MeshButtonsPanel, PropertyPanel, Panel):
@@ -572,17 +586,20 @@ class DATA_PT_mesh_attributes(MeshButtonsPanel, Panel):
def draw_attribute_warnings(self, context, layout):
ob = context.object
- mesh = ob.data
+ mesh = context.mesh
unique_names = set()
colliding_names = []
for collection in (
# Built-in names.
- {"position": None, "material_index": None, "shade_smooth": None, "normal": None, "crease": None},
+ {"position": None, "shade_smooth": None, "normal": None, "crease": None},
mesh.attributes,
mesh.uv_layers,
- ob.vertex_groups,
+ None if ob is None else ob.vertex_groups,
):
+ if collection is None:
+ colliding_names.append("Cannot check for object vertex groups when pinning mesh")
+ continue
for name in collection.keys():
unique_names_len = len(unique_names)
unique_names.add(name)
@@ -592,7 +609,7 @@ class DATA_PT_mesh_attributes(MeshButtonsPanel, Panel):
if not colliding_names:
return
- layout.label(text="Name collisions: " + ", ".join(set(colliding_names)), icon='ERROR')
+ layout.label(text=tip_("Name collisions: ") + ", ".join(set(colliding_names)), icon='ERROR')
class ColorAttributesListBase():