diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-28 14:45:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-28 14:45:59 +0400 |
commit | d984c46701280ab50a3ce2987d184ce780e113c6 (patch) | |
tree | cb6682a6b1bf6164ab87cc0124cde64689485fca /release/scripts | |
parent | 914b0aafa5693f5808f14522dcc57d9f2a695db0 (diff) |
remove type checks on drawing uiList's,
if the list is given the wrong item then the script needs to be fixed, better not fail silently.
left in checks as commented out asserts.
Diffstat (limited to 'release/scripts')
8 files changed, 10 insertions, 21 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index 7a7c847f040..538063cb038 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -56,8 +56,7 @@ class MESH_MT_shape_key_specials(Menu): class MESH_UL_vgroups(UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): - if not isinstance(item, bpy.types.VertexGroup): - return + # assert(isinstance(item, bpy.types.VertexGroup) vgroup = item if self.layout_type in {'DEFAULT', 'COMPACT'}: layout.label(vgroup.name, icon_value=icon) @@ -70,8 +69,7 @@ class MESH_UL_vgroups(UIList): class MESH_UL_shape_keys(UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): - if not isinstance(item, bpy.types.ShapeKey): - return + # assert(isinstance(item, bpy.types.ShapeKey) obj = active_data key = data key_block = item @@ -93,9 +91,7 @@ class MESH_UL_shape_keys(UIList): class MESH_UL_uvmaps_vcols(UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): - if not isinstance(item, (bpy.types.MeshTexturePolyLayer, bpy.types.MeshLoopColorLayer)): - print(item.__class__) - return + # assert(isinstance(item, (bpy.types.MeshTexturePolyLayer, bpy.types.MeshLoopColorLayer)) if self.layout_type in {'DEFAULT', 'COMPACT'}: layout.label(item.name, icon_value=icon) icon = 'RESTRICT_RENDER_OFF' if item.active_render else 'RESTRICT_RENDER_ON' diff --git a/release/scripts/startup/bl_ui/properties_mask_common.py b/release/scripts/startup/bl_ui/properties_mask_common.py index ea04b79357e..9861db39f30 100644 --- a/release/scripts/startup/bl_ui/properties_mask_common.py +++ b/release/scripts/startup/bl_ui/properties_mask_common.py @@ -27,8 +27,7 @@ from bpy.types import Menu, UIList class MASK_UL_layers(UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): - if not isinstance(item, bpy.types.MaskLayer): - return + # assert(isinstance(item, bpy.types.MaskLayer) mask = item if self.layout_type in {'DEFAULT', 'COMPACT'}: split = layout.split() diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index df676499cfb..7e18cf89080 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -71,8 +71,7 @@ class MATERIAL_MT_specials(Menu): class MATERIAL_UL_matslots(UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): - if not isinstance(item, bpy.types.MaterialSlot): - return + # assert(isinstance(item, bpy.types.MaterialSlot) ob = data slot = item ma = slot.material diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index b102f1b09d0..9393852b8a5 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -27,8 +27,7 @@ from bl_ui.properties_physics_common import (point_cache_ui, class PHYSICS_UL_dynapaint_surfaces(UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): - if not isinstance(item, bpy.types.DynamicPaintSurface): - return + # assert(isinstance(item, bpy.types.DynamicPaintSurface) surf = item sticon = layout.enum_item_icon(surf, "surface_type", surf.surface_type) if self.layout_type in {'DEFAULT', 'COMPACT'}: diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index 6f0cf6bc691..8dfa954dade 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -45,8 +45,7 @@ class RENDER_MT_framerate_presets(Menu): class RENDER_UL_renderlayers(UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): - if not isinstance(item, bpy.types.SceneRenderLayer): - return + # assert(isinstance(item, bpy.types.SceneRenderLayer) layer = item if self.layout_type in {'DEFAULT', 'COMPACT'}: layout.label(layer.name, icon_value=icon) diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index 100c7d93c77..3230fb7392b 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -24,8 +24,7 @@ from rna_prop_ui import PropertyPanel class SCENE_UL_keying_set_paths(UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): - if not isinstance(item, bpy.types.KeyingSetPath): - return + # assert(isinstance(item, bpy.types.KeyingSetPath) kspath = item icon = layout.enum_item_icon(kspath, "id_type", kspath.id_type) if self.layout_type in {'DEFAULT', 'COMPACT'}: diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index 33b8e126398..cb7cc1d42d2 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -58,8 +58,7 @@ class TEXTURE_MT_envmap_specials(Menu): class TEXTURE_UL_texslots(UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): - if not (item is None or isinstance(item, bpy.types.MaterialTextureSlot)): - return + # assert(isinstance(item, bpy.types.MaterialTextureSlot) ma = data slot = item tex = slot.texture if slot else None diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index cf5b94277e7..5fc57133767 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -24,8 +24,7 @@ from bpy.types import Panel, Header, Menu, UIList class CLIP_UL_tracking_objects(UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): - if not (item is None or isinstance(item, bpy.types.MovieTrackingObject)): - return + # assert(isinstance(item, bpy.types.MovieTrackingObject) tobj = item if self.layout_type in {'DEFAULT', 'COMPACT'}: layout.label(tobj.name, icon='CAMERA_DATA' if tobj.is_camera else 'OBJECT_DATA') |