2.5 Buttons
[blender-staging.git] / release / ui / buttons_data_mesh.py
index e52bc8cb9570a222d41ceef9043413c42c224c2e..6e9a30cefbcfc5e6046590b4df0b6c94fbcdc0d9 100644 (file)
@@ -1,4 +1,4 @@
-               
+
 import bpy
 
 class DataButtonsPanel(bpy.types.Panel):
@@ -9,27 +9,26 @@ class DataButtonsPanel(bpy.types.Panel):
        def poll(self, context):
                ob = context.active_object
                return (ob and ob.type == 'MESH')
-       
 
 class DATA_PT_surface(DataButtonsPanel):
                __idname__ = "DATA_PT_surface"
-               __label__ = "Surface"
+               __label__ = "Mesh"
 
                def draw(self, context):
-                       mesh = context.main.meshes[0]
+                       mesh = context.active_object.data
                        layout = self.layout
 
-                       if not mesh:
-                               return
                        split = layout.split()
                
-                       sub = split.column()
-                       sub.itemR(mesh, "autosmooth")
-                       sub.itemR(mesh, "autosmooth_angle", text="Angle")
+                       col = split.column()
+                       col.itemR(mesh, "autosmooth")
+                       colsub = col.column()
+                       colsub.active = mesh.autosmooth
+                       colsub.itemR(mesh, "autosmooth_angle", text="Angle")
                        sub = split.column()
                        sub.itemR(mesh, "vertex_normal_flip")
                        sub.itemR(mesh, "double_sided")
-                       row = layout.row()
-                       row.itemR(mesh, "texco_mesh")                   
+                       
+                       layout.itemR(mesh, "texco_mesh")                        
                                                
-bpy.types.register(DATA_PT_surface)            
\ No newline at end of file
+bpy.types.register(DATA_PT_surface)
\ No newline at end of file