remove type checks on drawing uiList's,
authorCampbell Barton <ideasman42@gmail.com>
Fri, 28 Dec 2012 10:45:59 +0000 (10:45 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 28 Dec 2012 10:45:59 +0000 (10:45 +0000)
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.

release/scripts/startup/bl_ui/properties_data_mesh.py
release/scripts/startup/bl_ui/properties_mask_common.py
release/scripts/startup/bl_ui/properties_material.py
release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
release/scripts/startup/bl_ui/properties_render.py
release/scripts/startup/bl_ui/properties_scene.py
release/scripts/startup/bl_ui/properties_texture.py
release/scripts/startup/bl_ui/space_clip.py

index 7a7c847f0405656f84e5aae716e5d8f1bd04d044..538063cb038f543e2e2fd6c70c4a6d45ef7dbb93 100644 (file)
@@ -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'
index ea04b79357ee84777f28864bf91b031db25fc669..9861db39f308ed6375abc6dddfdf0883658b9b7f 100644 (file)
@@ -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()
index df676499cfb64b1fa94bfaf54452651fdd535381..7e18cf8908035e09cc1838d701424fbc61b1d244 100644 (file)
@@ -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
index b102f1b09d053f33f6d4581075b6155229ddce00..9393852b8a55437275727ed6156fd4c7e6e2dc4c 100644 (file)
@@ -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'}:
index 6f0cf6bc69104605f9f8bccf0dd9618a467bd7c4..8dfa954dade1cfdbf688b9d4625b90a70e0cfabf 100644 (file)
@@ -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)
index 100c7d93c775ba2990e0526e8979ed156152859c..3230fb7392bac5833d0da015ef234dbf6d0ac594 100644 (file)
@@ -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'}:
index 33b8e126398de0349d145c2b5336fe4f4ac9ecd9..cb7cc1d42d2fffae8802d80e7fe1982a6c57b23d 100644 (file)
@@ -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
index cf5b94277e7560e6bb17eaab8cafe0416486ff9c..5fc571337675ff29d6a35a302577dc89b6015272 100644 (file)
@@ -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')