Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_data_camera.py
| Show All 35 Lines | |||||
| class CAMERA_MT_presets(Menu): | class CAMERA_MT_presets(Menu): | ||||
| bl_label = "Camera Presets" | bl_label = "Camera Presets" | ||||
| preset_subdir = "camera" | preset_subdir = "camera" | ||||
| preset_operator = "script.execute_preset" | preset_operator = "script.execute_preset" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| draw = Menu.draw_preset | draw = Menu.draw_preset | ||||
| class SAFE_AREAS_MT_presets(Menu): | |||||
| bl_label = "Camera Presets" | |||||
| preset_subdir = "safe_areas" | |||||
| preset_operator = "script.execute_preset" | |||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | |||||
| draw = Menu.draw_preset | |||||
| class DATA_PT_context_camera(CameraButtonsPanel, Panel): | class DATA_PT_context_camera(CameraButtonsPanel, Panel): | ||||
| bl_label = "" | bl_label = "" | ||||
| bl_options = {'HIDE_HEADER'} | bl_options = {'HIDE_HEADER'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | class DATA_PT_camera_dof(CameraButtonsPanel, Panel): | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| cam = context.camera | cam = context.camera | ||||
| layout.label(text="Focus:") | layout.label(text="Focus:") | ||||
| split = layout.split() | split = layout.split() | ||||
| split.prop(cam, "dof_object", text="") | split.prop(cam, "dof_object", text="") | ||||
campbellbarton: These can be removed. | |||||
| col = split.column() | col = split.column() | ||||
| col.active = cam.dof_object is None | col.active = cam.dof_object is None | ||||
| col.prop(cam, "dof_distance", text="Distance") | col.prop(cam, "dof_distance", text="Distance") | ||||
| class DATA_PT_camera_display(CameraButtonsPanel, Panel): | class DATA_PT_camera_display(CameraButtonsPanel, Panel): | ||||
| bl_label = "Display" | bl_label = "Display" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
Not Done Inline ActionsTo prevent interface jump, use disabled row instead of skipping the option entirely. sergey: To prevent interface jump, use disabled row instead of skipping the option entirely. | |||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| cam = context.camera | cam = context.camera | ||||
| split = layout.split() | split = layout.split() | ||||
| col = split.column() | col = split.column() | ||||
| col.prop(cam, "show_limits", text="Limits") | col.prop(cam, "show_limits", text="Limits") | ||||
| col.prop(cam, "show_mist", text="Mist") | col.prop(cam, "show_mist", text="Mist") | ||||
| col.prop(cam, "show_title_safe", text="Safe Areas") | |||||
| col.prop(cam, "show_sensor", text="Sensor") | col.prop(cam, "show_sensor", text="Sensor") | ||||
| col.prop(cam, "show_name", text="Name") | col.prop(cam, "show_name", text="Name") | ||||
| col = split.column() | col = split.column() | ||||
| col.prop_menu_enum(cam, "show_guide") | col.prop_menu_enum(cam, "show_guide") | ||||
| col.separator() | col.separator() | ||||
| col.prop(cam, "draw_size", text="Size") | col.prop(cam, "draw_size", text="Size") | ||||
| col.separator() | col.separator() | ||||
| col.prop(cam, "show_passepartout", text="Passepartout") | col.prop(cam, "show_passepartout", text="Passepartout") | ||||
| sub = col.column() | sub = col.column() | ||||
| sub.active = cam.show_passepartout | 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_camera_safe_areas(CameraButtonsPanel, Panel): | |||||
| bl_label = "Safe Areas" | |||||
| bl_options = {'DEFAULT_CLOSED'} | |||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | |||||
| def draw_header(self, context): | |||||
| cam = context.camera | |||||
Not Done Inline Actionswhy not? enable_cc = cam.show_title_safe campbellbarton: why not? `enable_cc = cam.show_title_safe` | |||||
| self.layout.prop(cam, "show_safe_areas", text="") | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| cam = context.camera | |||||
| draw_display_safe_settings(layout, cam) | |||||
| class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, Panel): | class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, Panel): | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| _context_path = "object.data" | _context_path = "object.data" | ||||
| _property_type = bpy.types.Camera | _property_type = bpy.types.Camera | ||||
| def draw_display_safe_settings(layout, settings): | |||||
| safe_data = bpy.context.scene.safe_areas | |||||
| show_safe_areas = settings.show_safe_areas | |||||
| show_safe_center = settings.show_safe_center | |||||
| row = layout.row(align=True) | |||||
| row.menu("SAFE_AREAS_MT_presets", text=bpy.types.SAFE_AREAS_MT_presets.bl_label) | |||||
| row.operator("safe_areas.preset_add", text="", icon='ZOOMIN') | |||||
| row.operator("safe_areas.preset_add", text="", icon='ZOOMOUT').remove_active = True | |||||
| layout.separator() | |||||
| row = layout.row() | |||||
Not Done Inline Actions- show_safe_center + show_safe_areas and show_safe_center dfelinto: ```
- show_safe_center
+ show_safe_areas and show_safe_center
``` | |||||
| row.prop(settings, "show_safe_center", text="Center-Cut Safe Areas") | |||||
| split = layout.split() | |||||
| col = split.column(align=True) | |||||
| col.active = show_safe_areas | |||||
| col.prop(safe_data, "title", slider=True) | |||||
| col.separator() | |||||
| col.prop(safe_data, "action", slider=True) | |||||
Not Done Inline ActionsRemove a line, we leave 2 line separation between top-nested levels in Python (same for before DATA_PT_camera_safe_areas, same for after SEQUENCER_PT_view_safe_areas) dfelinto: Remove a line, we leave 2 line separation between top-nested levels in Python (same for before… | |||||
| col = split.column(align=True) | |||||
| col.active = show_safe_areas and show_safe_center | |||||
| col.prop(safe_data, "title_center", slider=True) | |||||
| col.separator() | |||||
| col.prop(safe_data, "action_center", slider=True) | |||||
| if __name__ == "__main__": # only for live edit. | if __name__ == "__main__": # only for live edit. | ||||
| bpy.utils.register_module(__name__) | bpy.utils.register_module(__name__) | ||||
These can be removed.