Cycles: svn merge -r41225:41232 ^/trunk/blender
[blender.git] / release / scripts / startup / bl_ui / properties_data_camera.py
index b3f1f861b8168dbdc7c6e46354391e84ccb3f3eb..7787773177762d79f0bd39dab662058e478c7274 100644 (file)
@@ -18,8 +18,9 @@
 
 # <pep8 compliant>
 import bpy
+from bpy.types import Panel
 from rna_prop_ui import PropertyPanel
-from blf import gettext as _
+
 
 class CameraButtonsPanel():
     bl_space_type = 'PROPERTIES'
@@ -32,7 +33,7 @@ class CameraButtonsPanel():
         return context.camera and (engine in cls.COMPAT_ENGINES)
 
 
-class DATA_PT_context_camera(CameraButtonsPanel, bpy.types.Panel):
+class DATA_PT_context_camera(CameraButtonsPanel, Panel):
     bl_label = ""
     bl_options = {'HIDE_HEADER'}
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -53,8 +54,8 @@ class DATA_PT_context_camera(CameraButtonsPanel, bpy.types.Panel):
             split.separator()
 
 
-class DATA_PT_camera(CameraButtonsPanel, bpy.types.Panel):
-    bl_label = _("Lens")
+class DATA_PT_camera(CameraButtonsPanel, Panel):
+    bl_label = "Lens"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
     def draw(self, context):
@@ -90,29 +91,34 @@ class DATA_PT_camera(CameraButtonsPanel, bpy.types.Panel):
         split = layout.split()
 
         col = split.column(align=True)
-        col.label(text=_("Shift:"))
+        col.label(text="Shift:")
         col.prop(cam, "shift_x", text="X")
         col.prop(cam, "shift_y", text="Y")
 
         col = split.column(align=True)
-        col.label(text=_("Clipping:"))
-        col.prop(cam, "clip_start", text=_("Start"))
-        col.prop(cam, "clip_end", text=_("End"))
+        col.label(text="Clipping:")
+        col.prop(cam, "clip_start", text="Start")
+        col.prop(cam, "clip_end", text="End")
+
+class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
+    bl_label = "Depth of Field"
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+
+    def draw(self, context):
+        layout = self.layout
 
-        layout.label(text=_("Depth of Field:"))
+        cam = context.camera
 
         split = layout.split()
         split.prop(cam, "dof_object", text="")
 
         col = split.column()
 
-        if cam.dof_object != None:
-            col.enabled = False
-        col.prop(cam, "dof_distance", text=_("Distance"))
-
+        col.active = cam.dof_object is None
+        col.prop(cam, "dof_distance", text="Distance")
 
-class DATA_PT_camera_display(CameraButtonsPanel, bpy.types.Panel):
-    bl_label = _("Display")
+class DATA_PT_camera_display(CameraButtonsPanel, Panel):
+    bl_label = "Display"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
     def draw(self, context):
@@ -123,22 +129,22 @@ class DATA_PT_camera_display(CameraButtonsPanel, bpy.types.Panel):
         split = layout.split()
 
         col = split.column()
-        col.prop(cam, "show_limits", text=_("Limits"))
-        col.prop(cam, "show_mist", text=_("Mist"))
-        col.prop(cam, "show_title_safe", text=_("Title Safe"))
-        col.prop(cam, "show_name", text=_("Name"))
+        col.prop(cam, "show_limits", text="Limits")
+        col.prop(cam, "show_mist", text="Mist")
+        col.prop(cam, "show_title_safe", text="Title Safe")
+        col.prop(cam, "show_name", text="Name")
         col.prop_menu_enum(cam, "show_guide")
 
         col = split.column()
-        col.prop(cam, "draw_size", text=_("Size"))
+        col.prop(cam, "draw_size", text="Size")
         col.separator()
-        col.prop(cam, "show_passepartout", text=_("Passepartout"))
+        col.prop(cam, "show_passepartout", text="Passepartout")
         sub = col.column()
         sub.active = cam.show_passepartout
-        sub.prop(cam, "passepartout_alpha", text=_("Alpha"), slider=True)
+        sub.prop(cam, "passepartout_alpha", text="Alpha", slider=True)
 
 
-class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, bpy.types.Panel):
+class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, Panel):
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
     _context_path = "object.data"
     _property_type = bpy.types.Camera