Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_data_mesh.py
| Show First 20 Lines • Show All 165 Lines • ▼ Show 20 Lines | class MeshButtonsPanel: | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| engine = context.engine | engine = context.engine | ||||
| return context.mesh and (engine in cls.COMPAT_ENGINES) | return context.mesh and (engine in cls.COMPAT_ENGINES) | ||||
| class DATA_PT_context_mesh(MeshButtonsPanel, Panel): | class DATA_PT_context_mesh(MeshButtonsPanel, Panel): | ||||
| bl_label = "" | bl_label = "" | ||||
| bl_options = {'HIDE_HEADER'} | bl_options = {'HIDE_HEADER'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ob = context.object | ob = context.object | ||||
| mesh = context.mesh | mesh = context.mesh | ||||
| space = context.space_data | space = context.space_data | ||||
| if ob: | if ob: | ||||
| layout.template_ID(ob, "data") | layout.template_ID(ob, "data") | ||||
| elif mesh: | elif mesh: | ||||
| layout.template_ID(space, "pin_id") | layout.template_ID(space, "pin_id") | ||||
| class DATA_PT_normals(MeshButtonsPanel, Panel): | class DATA_PT_normals(MeshButtonsPanel, Panel): | ||||
| bl_label = "Normals" | bl_label = "Normals" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| mesh = context.mesh | mesh = context.mesh | ||||
| col = layout.column(align=False, heading="Auto Smooth") | col = layout.column(align=False, heading="Auto Smooth") | ||||
| col.use_property_decorate = False | col.use_property_decorate = False | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| sub = row.row(align=True) | sub = row.row(align=True) | ||||
| sub.prop(mesh, "use_auto_smooth", text="") | sub.prop(mesh, "use_auto_smooth", text="") | ||||
| sub = sub.row(align=True) | sub = sub.row(align=True) | ||||
| sub.active = mesh.use_auto_smooth and not mesh.has_custom_normals | sub.active = mesh.use_auto_smooth and not mesh.has_custom_normals | ||||
| sub.prop(mesh, "auto_smooth_angle", text="") | sub.prop(mesh, "auto_smooth_angle", text="") | ||||
| row.prop_decorator(mesh, "auto_smooth_angle") | row.prop_decorator(mesh, "auto_smooth_angle") | ||||
| class DATA_PT_texture_space(MeshButtonsPanel, Panel): | class DATA_PT_texture_space(MeshButtonsPanel, Panel): | ||||
| bl_label = "Texture Space" | bl_label = "Texture Space" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| mesh = context.mesh | mesh = context.mesh | ||||
| layout.prop(mesh, "texture_mesh") | layout.prop(mesh, "texture_mesh") | ||||
| layout.separator() | layout.separator() | ||||
| layout.prop(mesh, "use_auto_texspace") | layout.prop(mesh, "use_auto_texspace") | ||||
| layout.prop(mesh, "texspace_location", text="Location") | layout.prop(mesh, "texspace_location", text="Location") | ||||
| layout.prop(mesh, "texspace_size", text="Size") | layout.prop(mesh, "texspace_size", text="Size") | ||||
| class DATA_PT_vertex_groups(MeshButtonsPanel, Panel): | class DATA_PT_vertex_groups(MeshButtonsPanel, Panel): | ||||
| bl_label = "Vertex Groups" | bl_label = "Vertex Groups" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| engine = context.engine | engine = context.engine | ||||
| obj = context.object | obj = context.object | ||||
| return (obj and obj.type in {'MESH', 'LATTICE'} and (engine in cls.COMPAT_ENGINES)) | return (obj and obj.type in {'MESH', 'LATTICE'} and (engine in cls.COMPAT_ENGINES)) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| Show All 40 Lines | def draw(self, context): | ||||
| sub.operator("object.vertex_group_deselect", text="Deselect") | sub.operator("object.vertex_group_deselect", text="Deselect") | ||||
| layout.prop(context.tool_settings, "vertex_group_weight", text="Weight") | layout.prop(context.tool_settings, "vertex_group_weight", text="Weight") | ||||
| class DATA_PT_face_maps(MeshButtonsPanel, Panel): | class DATA_PT_face_maps(MeshButtonsPanel, Panel): | ||||
| bl_label = "Face Maps" | bl_label = "Face Maps" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| obj = context.object | obj = context.object | ||||
| return (obj and obj.type == 'MESH') | return (obj and obj.type == 'MESH') | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| Show All 26 Lines | def draw(self, context): | ||||
| sub = row.row(align=True) | sub = row.row(align=True) | ||||
| sub.operator("object.face_map_select", text="Select") | sub.operator("object.face_map_select", text="Select") | ||||
| sub.operator("object.face_map_deselect", text="Deselect") | sub.operator("object.face_map_deselect", text="Deselect") | ||||
| class DATA_PT_shape_keys(MeshButtonsPanel, Panel): | class DATA_PT_shape_keys(MeshButtonsPanel, Panel): | ||||
| bl_label = "Shape Keys" | bl_label = "Shape Keys" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| engine = context.engine | engine = context.engine | ||||
| obj = context.object | obj = context.object | ||||
| return (obj and obj.type in {'MESH', 'LATTICE', 'CURVE', 'SURFACE'} and (engine in cls.COMPAT_ENGINES)) | return (obj and obj.type in {'MESH', 'LATTICE', 'CURVE', 'SURFACE'} and (engine in cls.COMPAT_ENGINES)) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| ▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| row.prop(key, "eval_time") | row.prop(key, "eval_time") | ||||
| layout.prop(ob, "add_rest_position_attribute") | layout.prop(ob, "add_rest_position_attribute") | ||||
| class DATA_PT_uv_texture(MeshButtonsPanel, Panel): | class DATA_PT_uv_texture(MeshButtonsPanel, Panel): | ||||
| bl_label = "UV Maps" | bl_label = "UV Maps" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| me = context.mesh | me = context.mesh | ||||
| row = layout.row() | row = layout.row() | ||||
| col = row.column() | col = row.column() | ||||
| col.template_list("MESH_UL_uvmaps", "uvmaps", me, "uv_layers", me.uv_layers, "active_index", rows=2) | col.template_list("MESH_UL_uvmaps", "uvmaps", me, "uv_layers", me.uv_layers, "active_index", rows=2) | ||||
| col = row.column(align=True) | col = row.column(align=True) | ||||
| col.operator("mesh.uv_texture_add", icon='ADD', text="") | col.operator("mesh.uv_texture_add", icon='ADD', text="") | ||||
| col.operator("mesh.uv_texture_remove", icon='REMOVE', text="") | col.operator("mesh.uv_texture_remove", icon='REMOVE', text="") | ||||
| class DATA_PT_remesh(MeshButtonsPanel, Panel): | class DATA_PT_remesh(MeshButtonsPanel, Panel): | ||||
| bl_label = "Remesh" | bl_label = "Remesh" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False | layout.use_property_decorate = False | ||||
| row = layout.row() | row = layout.row() | ||||
| mesh = context.mesh | mesh = context.mesh | ||||
| Show All 13 Lines | def draw(self, context): | ||||
| col.operator("object.voxel_remesh", text="Voxel Remesh") | col.operator("object.voxel_remesh", text="Voxel Remesh") | ||||
| else: | else: | ||||
| col.operator("object.quadriflow_remesh", text="QuadriFlow Remesh") | col.operator("object.quadriflow_remesh", text="QuadriFlow Remesh") | ||||
| class DATA_PT_customdata(MeshButtonsPanel, Panel): | class DATA_PT_customdata(MeshButtonsPanel, Panel): | ||||
| bl_label = "Geometry Data" | bl_label = "Geometry Data" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False | layout.use_property_decorate = False | ||||
| obj = context.object | obj = context.object | ||||
| me = context.mesh | me = context.mesh | ||||
| Show All 24 Lines | def draw(self, context): | ||||
| if me.has_crease_vertex: | if me.has_crease_vertex: | ||||
| col.operator("mesh.customdata_crease_vertex_clear", icon='X') | col.operator("mesh.customdata_crease_vertex_clear", icon='X') | ||||
| else: | else: | ||||
| col.operator("mesh.customdata_crease_vertex_add", icon='ADD') | col.operator("mesh.customdata_crease_vertex_add", icon='ADD') | ||||
| class DATA_PT_custom_props_mesh(MeshButtonsPanel, PropertyPanel, Panel): | class DATA_PT_custom_props_mesh(MeshButtonsPanel, PropertyPanel, Panel): | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| _context_path = "object.data" | _context_path = "object.data" | ||||
| _property_type = bpy.types.Mesh | _property_type = bpy.types.Mesh | ||||
| class MESH_UL_attributes(UIList): | class MESH_UL_attributes(UIList): | ||||
| display_domain_names = { | display_domain_names = { | ||||
| 'POINT': "Vertex", | 'POINT': "Vertex", | ||||
| 'EDGE': "Edge", | 'EDGE': "Edge", | ||||
| Show All 32 Lines | def draw_item(self, _context, layout, _data, attribute, _icon, _active_data, _active_propname, _index): | ||||
| sub.active = False | sub.active = False | ||||
| sub.label(text="%s ▶ %s" % (iface_(domain_name), iface_(data_type.name)), | sub.label(text="%s ▶ %s" % (iface_(domain_name), iface_(data_type.name)), | ||||
| translate=False) | translate=False) | ||||
| class DATA_PT_mesh_attributes(MeshButtonsPanel, Panel): | class DATA_PT_mesh_attributes(MeshButtonsPanel, Panel): | ||||
| bl_label = "Attributes" | bl_label = "Attributes" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| mesh = context.mesh | mesh = context.mesh | ||||
| layout = self.layout | layout = self.layout | ||||
| row = layout.row() | row = layout.row() | ||||
| col = row.column() | col = row.column() | ||||
| ▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | class MESH_UL_color_attributes_selector(UIList, ColorAttributesListBase): | ||||
| def draw_item(self, _context, layout, _data, attribute, _icon, _active_data, _active_propname, _index): | def draw_item(self, _context, layout, _data, attribute, _icon, _active_data, _active_propname, _index): | ||||
| layout.emboss = 'NONE' | layout.emboss = 'NONE' | ||||
| layout.prop(attribute, "name", text="", icon='GROUP_VCOL') | layout.prop(attribute, "name", text="", icon='GROUP_VCOL') | ||||
| class DATA_PT_vertex_colors(DATA_PT_mesh_attributes, Panel): | class DATA_PT_vertex_colors(DATA_PT_mesh_attributes, Panel): | ||||
| bl_label = "Color Attributes" | bl_label = "Color Attributes" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| mesh = context.mesh | mesh = context.mesh | ||||
| layout = self.layout | layout = self.layout | ||||
| row = layout.row() | row = layout.row() | ||||
| col = row.column() | col = row.column() | ||||
| ▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines | |||||