2.5 Buttons
[blender-staging.git] / release / ui / buttons_data_lattice.py
index 0446f3916a17b6afda5eac270b55441e2ea63fe6..4bcff9f53892f75f0c4ba1d47dc93ae8b9f66a00 100644 (file)
@@ -15,12 +15,9 @@ class DATA_PT_lattice(DataButtonsPanel):
        __label__ = "Lattice"
 
        def draw(self, context):
-               lat = context.main.lattices[0]
+               lat = context.active_object.data
                layout = self.layout
 
-               if not lat:
-                       return
-               
                row = layout.row()
                row.itemR(lat, "points_u")
                row.itemR(lat, "interpolation_type_u", expand=True)
@@ -37,4 +34,4 @@ class DATA_PT_lattice(DataButtonsPanel):
                row.itemR(lat, "outside")
                row.itemR(lat, "shape_keys")
 
-bpy.types.register(DATA_PT_lattice)
+bpy.types.register(DATA_PT_lattice)
\ No newline at end of file