fix for some python errors
authorCampbell Barton <ideasman42@gmail.com>
Wed, 4 Nov 2009 16:26:08 +0000 (16:26 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 4 Nov 2009 16:26:08 +0000 (16:26 +0000)
release/scripts/ui/space_view3d.py
release/scripts/ui/space_view3d_toolbar.py

index ba6f1c4740d768c71acd43a28c15f050bdd9a893..1567da12173310dc3d96a4e2b4ef0a342f2e1a56 100644 (file)
@@ -1388,8 +1388,8 @@ class VIEW3D_PT_3dview_meshdisplay(bpy.types.Panel):
     bl_label = "Mesh Display"
 
     def poll(self, context):
-        editmesh = context.mode == 'EDIT_MESH'
-        return (editmesh)
+        # The active object check is needed because of localmode
+        return (context.active_object and (context.mode == 'EDIT_MESH'))
 
     def draw(self, context):
         layout = self.layout
index 809201b55b4537be90a0b09c2d5ef8536ba0dde2..1d421e1f4081d904dace929f5539726eb23c80a3 100644 (file)
@@ -134,10 +134,12 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel):
     def draw(self, context):
         layout = self.layout
 
-        mesh = context.active_object.data
+        ob = context.active_object
 
-        col = layout.column(align=True)
-        col.itemR(mesh, "use_mirror_x")
+        if ob:
+            mesh = context.active_object.data
+            col = layout.column(align=True)
+            col.itemR(mesh, "use_mirror_x")
 
 # ********** default tools for editmode_curve ****************