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/ui/properties_data_mesh.py')
-rw-r--r--release/scripts/ui/properties_data_mesh.py114
1 files changed, 39 insertions, 75 deletions
diff --git a/release/scripts/ui/properties_data_mesh.py b/release/scripts/ui/properties_data_mesh.py
index c3170be8860..1be2ce824fa 100644
--- a/release/scripts/ui/properties_data_mesh.py
+++ b/release/scripts/ui/properties_data_mesh.py
@@ -20,8 +20,6 @@
import bpy
from rna_prop_ui import PropertyPanel
-narrowui = bpy.context.user_preferences.view.properties_width_check
-
class MESH_MT_vertex_group_specials(bpy.types.Menu):
bl_label = "Vertex Group Specials"
@@ -49,17 +47,18 @@ class MESH_MT_shape_key_specials(bpy.types.Menu):
layout.operator("object.shape_key_mirror", icon='ARROW_LEFTRIGHT')
-class DataButtonsPanel(bpy.types.Panel):
+class MeshButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
- def poll(self, context):
+ @classmethod
+ def poll(cls, context):
engine = context.scene.render.engine
- return context.mesh and (engine in self.COMPAT_ENGINES)
+ return context.mesh and (engine in cls.COMPAT_ENGINES)
-class DATA_PT_context_mesh(DataButtonsPanel):
+class DATA_PT_context_mesh(MeshButtonsPanel, bpy.types.Panel):
bl_label = ""
bl_show_header = False
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -70,29 +69,22 @@ class DATA_PT_context_mesh(DataButtonsPanel):
ob = context.object
mesh = context.mesh
space = context.space_data
- wide_ui = context.region.width > narrowui
-
- if wide_ui:
- split = layout.split(percentage=0.65)
- if ob:
- split.template_ID(ob, "data")
- split.separator()
- elif mesh:
- split.template_ID(space, "pin_id")
- split.separator()
- else:
- if ob:
- layout.template_ID(ob, "data")
- elif mesh:
- layout.template_ID(space, "pin_id")
+ split = layout.split(percentage=0.65)
+ if ob:
+ split.template_ID(ob, "data")
+ split.separator()
+ elif mesh:
+ split.template_ID(space, "pin_id")
+ split.separator()
-class DATA_PT_custom_props_mesh(DataButtonsPanel, PropertyPanel):
- _context_path = "object.data"
+
+class DATA_PT_custom_props_mesh(MeshButtonsPanel, PropertyPanel, bpy.types.Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+ _context_path = "object.data"
-class DATA_PT_normals(DataButtonsPanel):
+class DATA_PT_normals(MeshButtonsPanel, bpy.types.Panel):
bl_label = "Normals"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -100,7 +92,6 @@ class DATA_PT_normals(DataButtonsPanel):
layout = self.layout
mesh = context.mesh
- wide_ui = context.region.width > narrowui
split = layout.split()
@@ -110,14 +101,12 @@ class DATA_PT_normals(DataButtonsPanel):
sub.active = mesh.autosmooth
sub.prop(mesh, "autosmooth_angle", text="Angle")
- if wide_ui:
- col = split.column()
- else:
- col.separator()
+ col = split.column()
+
col.prop(mesh, "double_sided")
-class DATA_PT_settings(DataButtonsPanel):
+class DATA_PT_settings(MeshButtonsPanel, bpy.types.Panel):
bl_label = "Settings"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -129,13 +118,15 @@ class DATA_PT_settings(DataButtonsPanel):
layout.prop(mesh, "texture_mesh")
-class DATA_PT_vertex_groups(DataButtonsPanel):
+class DATA_PT_vertex_groups(MeshButtonsPanel, bpy.types.Panel):
bl_label = "Vertex Groups"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
- def poll(self, context):
+ @classmethod
+ def poll(cls, context):
engine = context.scene.render.engine
- return (context.object and context.object.type in ('MESH', 'LATTICE') and (engine in self.COMPAT_ENGINES))
+ obj = context.object
+ return (obj and obj.type in ('MESH', 'LATTICE') and (engine in cls.COMPAT_ENGINES))
def draw(self, context):
layout = self.layout
@@ -176,13 +167,15 @@ class DATA_PT_vertex_groups(DataButtonsPanel):
layout.prop(context.tool_settings, "vertex_group_weight", text="Weight")
-class DATA_PT_shape_keys(DataButtonsPanel):
+class DATA_PT_shape_keys(MeshButtonsPanel, bpy.types.Panel):
bl_label = "Shape Keys"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
- def poll(self, context):
+ @classmethod
+ def poll(cls, context):
engine = context.scene.render.engine
- return (context.object and context.object.type in ('MESH', 'LATTICE', 'CURVE', 'SURFACE') and (engine in self.COMPAT_ENGINES))
+ obj = context.object
+ return (obj and obj.type in ('MESH', 'LATTICE', 'CURVE', 'SURFACE') and (engine in cls.COMPAT_ENGINES))
def draw(self, context):
layout = self.layout
@@ -190,7 +183,6 @@ class DATA_PT_shape_keys(DataButtonsPanel):
ob = context.object
key = ob.data.shape_keys
kb = ob.active_shape_key
- wide_ui = context.region.width > narrowui
enable_edit = ob.mode != 'EDIT'
enable_edit_value = False
@@ -223,17 +215,11 @@ class DATA_PT_shape_keys(DataButtonsPanel):
split = layout.split(percentage=0.4)
row = split.row()
row.enabled = enable_edit
- if wide_ui:
- row.prop(key, "relative")
+ row.prop(key, "relative")
row = split.row()
row.alignment = 'RIGHT'
- if not wide_ui:
- layout.prop(key, "relative")
- row = layout.row()
-
-
sub = row.row(align=True)
subsub = sub.row(align=True)
subsub.active = enable_edit_value
@@ -261,8 +247,7 @@ class DATA_PT_shape_keys(DataButtonsPanel):
col.prop(kb, "slider_min", text="Min")
col.prop(kb, "slider_max", text="Max")
- if wide_ui:
- col = split.column(align=True)
+ col = split.column(align=True)
col.active = enable_edit_value
col.label(text="Blend:")
col.prop_object(kb, "vertex_group", ob, "vertex_groups", text="")
@@ -274,7 +259,7 @@ class DATA_PT_shape_keys(DataButtonsPanel):
row.prop(key, "slurph")
-class DATA_PT_uv_texture(DataButtonsPanel):
+class DATA_PT_uv_texture(MeshButtonsPanel, bpy.types.Panel):
bl_label = "UV Texture"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -297,11 +282,12 @@ class DATA_PT_uv_texture(DataButtonsPanel):
layout.prop(lay, "name")
-class DATA_PT_texface(DataButtonsPanel):
+class DATA_PT_texface(MeshButtonsPanel, bpy.types.Panel):
bl_label = "Texture Face"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
- def poll(self, context):
+ @classmethod
+ def poll(cls, context):
ob = context.active_object
rd = context.scene.render
@@ -311,7 +297,6 @@ class DATA_PT_texface(DataButtonsPanel):
layout = self.layout
col = layout.column()
- wide_ui = context.region.width > narrowui
me = context.mesh
tf = me.faces.active_tface
@@ -329,8 +314,7 @@ class DATA_PT_texface(DataButtonsPanel):
col.prop(tf, "twoside")
col.prop(tf, "object_color")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.prop(tf, "halo")
col.prop(tf, "billboard")
@@ -344,7 +328,7 @@ class DATA_PT_texface(DataButtonsPanel):
col.label(text="No UV Texture")
-class DATA_PT_vertex_colors(DataButtonsPanel):
+class DATA_PT_vertex_colors(MeshButtonsPanel, bpy.types.Panel):
bl_label = "Vertex Colors"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -367,32 +351,12 @@ class DATA_PT_vertex_colors(DataButtonsPanel):
layout.prop(lay, "name")
-classes = [
- MESH_MT_vertex_group_specials,
- MESH_MT_shape_key_specials,
-
- DATA_PT_context_mesh,
- DATA_PT_normals,
- DATA_PT_settings,
- DATA_PT_vertex_groups,
- DATA_PT_shape_keys,
- DATA_PT_uv_texture,
- DATA_PT_texface,
- DATA_PT_vertex_colors,
-
- DATA_PT_custom_props_mesh]
-
-
def register():
- register = bpy.types.register
- for cls in classes:
- register(cls)
+ pass
def unregister():
- unregister = bpy.types.unregister
- for cls in classes:
- unregister(cls)
+ pass
if __name__ == "__main__":
register()