diff options
Diffstat (limited to 'release/scripts/ui/properties_data_mesh.py')
-rw-r--r-- | release/scripts/ui/properties_data_mesh.py | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/release/scripts/ui/properties_data_mesh.py b/release/scripts/ui/properties_data_mesh.py index b3d5215db58..e5a0f773df4 100644 --- a/release/scripts/ui/properties_data_mesh.py +++ b/release/scripts/ui/properties_data_mesh.py @@ -54,16 +54,17 @@ class DataButtonsPanel(): bl_region_type = 'WINDOW' bl_context = "data" - def poll(self, context): - engine = context.scene.render.engine - return context.mesh and (engine in self.COMPAT_ENGINES) - class DATA_PT_context_mesh(DataButtonsPanel, bpy.types.Panel): bl_label = "" bl_show_header = False COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + @staticmethod + def poll(context): + engine = context.scene.render.engine + return context.mesh and (engine in __class__.COMPAT_ENGINES) + def draw(self, context): layout = self.layout @@ -91,11 +92,21 @@ class DATA_PT_custom_props_mesh(DataButtonsPanel, PropertyPanel, bpy.types.Panel _context_path = "object.data" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + @staticmethod + def poll(context): + engine = context.scene.render.engine + return context.mesh and (engine in __class__.COMPAT_ENGINES) + class DATA_PT_normals(DataButtonsPanel, bpy.types.Panel): bl_label = "Normals" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + @staticmethod + def poll(context): + engine = context.scene.render.engine + return context.mesh and (engine in __class__.COMPAT_ENGINES) + def draw(self, context): layout = self.layout @@ -121,6 +132,11 @@ class DATA_PT_settings(DataButtonsPanel, bpy.types.Panel): bl_label = "Settings" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + @staticmethod + def poll(context): + engine = context.scene.render.engine + return context.mesh and (engine in __class__.COMPAT_ENGINES) + def draw(self, context): layout = self.layout @@ -133,9 +149,11 @@ class DATA_PT_vertex_groups(DataButtonsPanel, bpy.types.Panel): bl_label = "Vertex Groups" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} - def poll(self, context): + @staticmethod + def poll(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 __class__.COMPAT_ENGINES)) def draw(self, context): layout = self.layout @@ -180,9 +198,11 @@ class DATA_PT_shape_keys(DataButtonsPanel, bpy.types.Panel): bl_label = "Shape Keys" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} - def poll(self, context): + @staticmethod + def poll(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 __class__.COMPAT_ENGINES)) def draw(self, context): layout = self.layout @@ -278,6 +298,11 @@ class DATA_PT_uv_texture(DataButtonsPanel, bpy.types.Panel): bl_label = "UV Texture" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + @staticmethod + def poll(context): + engine = context.scene.render.engine + return context.mesh and (engine in __class__.COMPAT_ENGINES) + def draw(self, context): layout = self.layout @@ -301,7 +326,8 @@ class DATA_PT_texface(DataButtonsPanel): bl_label = "Texture Face" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} - def poll(self, context): + @staticmethod + def poll(context): ob = context.active_object rd = context.scene.render @@ -348,6 +374,11 @@ class DATA_PT_vertex_colors(DataButtonsPanel, bpy.types.Panel): bl_label = "Vertex Colors" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + @staticmethod + def poll(context): + engine = context.scene.render.engine + return context.mesh and (engine in __class__.COMPAT_ENGINES) + def draw(self, context): layout = self.layout |