Patch from William
[blender-staging.git] / release / ui / buttons_data_camera.py
index 9f3a062b4299e03bfabda9d26485281e9322b288..2092a34f9e8f6dc4656a2ceb1b75efe4b299c0ee 100644 (file)
@@ -9,9 +9,9 @@ class DataButtonsPanel(bpy.types.Panel):
        def poll(self, context):
                return (context.camera != None)
                
-class DATA_PT_camera(DataButtonsPanel):
-       __idname__ = "DATA_PT_camera"
-       __label__ = "Lens"
+class DATA_PT_context(DataButtonsPanel):
+       __idname__ = "DATA_PT_context"
+       __label__ = " "
        
        def poll(self, context):
                return (context.object and context.object.type == 'CAMERA')
@@ -32,6 +32,21 @@ class DATA_PT_camera(DataButtonsPanel):
                        split.template_ID(space, "pin_id")
                        split.itemS()
 
+
+class DATA_PT_camera(DataButtonsPanel):
+       __idname__ = "DATA_PT_camera"
+       __label__ = "Lens"
+       
+       def poll(self, context):
+               return (context.object and context.object.type == 'CAMERA')
+
+       def draw(self, context):
+               layout = self.layout
+               
+               ob = context.object
+               cam = context.camera
+               space = context.space_data
+
                if cam:
                        layout.itemS()
                        layout.itemR(cam, "type", expand=True)
@@ -86,5 +101,6 @@ class DATA_PT_camera_display(DataButtonsPanel):
                colsub.itemR(cam, "passepartout_alpha", text="Alpha", slider=True)
                col.itemR(cam, "draw_size", text="Size")
                
+bpy.types.register(DATA_PT_context)
 bpy.types.register(DATA_PT_camera)
 bpy.types.register(DATA_PT_camera_display)