diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-08-09 15:32:55 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-08-09 15:32:55 +0400 |
commit | dd75ec490761640571a0d8e53a0d439091f2736f (patch) | |
tree | 25b3966862febbf3ee8c81ed45f7045c99f84016 /release/scripts/ui/properties_data_camera.py | |
parent | 02b0967bd11dd6fd2454b37182d9f94ea451b603 (diff) | |
parent | c026b8066ddc1c42144d2e5132384ea7c1211050 (diff) |
Merged changes in the trunk up to revision 31190.
Diffstat (limited to 'release/scripts/ui/properties_data_camera.py')
-rw-r--r-- | release/scripts/ui/properties_data_camera.py | 84 |
1 files changed, 27 insertions, 57 deletions
diff --git a/release/scripts/ui/properties_data_camera.py b/release/scripts/ui/properties_data_camera.py index 3abd460c427..cda2b79c909 100644 --- a/release/scripts/ui/properties_data_camera.py +++ b/release/scripts/ui/properties_data_camera.py @@ -20,20 +20,19 @@ import bpy from rna_prop_ui import PropertyPanel -narrowui = bpy.context.user_preferences.view.properties_width_check - -class DataButtonsPanel(bpy.types.Panel): +class CameraButtonsPanel(): bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "data" - def poll(self, context): + @classmethod + def poll(cls, context): engine = context.scene.render.engine - return context.camera and (engine in self.COMPAT_ENGINES) + return context.camera and (engine in cls.COMPAT_ENGINES) -class DATA_PT_context_camera(DataButtonsPanel): +class DATA_PT_context_camera(CameraButtonsPanel, bpy.types.Panel): bl_label = "" bl_show_header = False COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} @@ -44,29 +43,22 @@ class DATA_PT_context_camera(DataButtonsPanel): ob = context.object cam = context.camera space = context.space_data - wide_ui = context.region.width > narrowui - - if wide_ui: - split = layout.split(percentage=0.65) - if ob: - split.template_ID(ob, "data") - split.separator() - elif cam: - split.template_ID(space, "pin_id") - split.separator() - else: - if ob: - layout.template_ID(ob, "data") - elif cam: - layout.template_ID(space, "pin_id") - - -class DATA_PT_custom_props_camera(DataButtonsPanel, PropertyPanel): - _context_path = "object.data" + + split = layout.split(percentage=0.65) + if ob: + split.template_ID(ob, "data") + split.separator() + elif cam: + split.template_ID(space, "pin_id") + split.separator() + + +class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, bpy.types.Panel): COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + _context_path = "object.data" -class DATA_PT_camera(DataButtonsPanel): +class DATA_PT_camera(CameraButtonsPanel, bpy.types.Panel): bl_label = "Lens" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} @@ -74,12 +66,8 @@ class DATA_PT_camera(DataButtonsPanel): layout = self.layout cam = context.camera - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(cam, "type", expand=True) - else: - layout.prop(cam, "type", text="") + layout.prop(cam, "type", expand=True) split = layout.split() @@ -89,8 +77,7 @@ class DATA_PT_camera(DataButtonsPanel): col.prop(cam, "lens", text="Angle") elif cam.lens_unit == 'DEGREES': col.prop(cam, "angle") - if wide_ui: - col = split.column() + col = split.column() col.prop(cam, "lens_unit", text="") elif cam.type == 'ORTHO': @@ -105,8 +92,7 @@ class DATA_PT_camera(DataButtonsPanel): col.prop(cam, "shift_x", text="X") col.prop(cam, "shift_y", text="Y") - if wide_ui: - col = split.column(align=True) + col = split.column(align=True) col.label(text="Clipping:") col.prop(cam, "clip_start", text="Start") col.prop(cam, "clip_end", text="End") @@ -118,16 +104,14 @@ class DATA_PT_camera(DataButtonsPanel): col = split.column() col.prop(cam, "dof_object", text="") - if wide_ui: - col = split.column() - else: - col = col.column() + col = split.column() + if cam.dof_object != None: col.enabled = False col.prop(cam, "dof_distance", text="Distance") -class DATA_PT_camera_display(DataButtonsPanel): +class DATA_PT_camera_display(CameraButtonsPanel, bpy.types.Panel): bl_label = "Display" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} @@ -135,7 +119,6 @@ class DATA_PT_camera_display(DataButtonsPanel): layout = self.layout cam = context.camera - wide_ui = context.region.width > narrowui split = layout.split() @@ -145,8 +128,7 @@ class DATA_PT_camera_display(DataButtonsPanel): col.prop(cam, "show_title_safe", text="Title Safe") col.prop(cam, "show_name", text="Name") - if wide_ui: - col = split.column() + col = split.column() col.prop(cam, "draw_size", text="Size") col.separator() col.prop(cam, "show_passepartout", text="Passepartout") @@ -155,24 +137,12 @@ class DATA_PT_camera_display(DataButtonsPanel): sub.prop(cam, "passepartout_alpha", text="Alpha", slider=True) -classes = [ - DATA_PT_context_camera, - DATA_PT_camera, - DATA_PT_camera_display, - - DATA_PT_custom_props_camera] - - def register(): - register = bpy.types.register - for cls in classes: - register(cls) + pass def unregister(): - unregister = bpy.types.unregister - for cls in classes: - unregister(cls) + pass if __name__ == "__main__": register() |