Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_data_camera.py
| Show All 33 Lines | def poll(cls, context): | ||||
| return context.camera and (engine in cls.COMPAT_ENGINES) | return context.camera and (engine in cls.COMPAT_ENGINES) | ||||
| class CAMERA_PT_presets(PresetMenu): | class CAMERA_PT_presets(PresetMenu): | ||||
| bl_label = "Camera Presets" | bl_label = "Camera Presets" | ||||
| preset_subdir = "camera" | preset_subdir = "camera" | ||||
| preset_operator = "script.execute_preset" | preset_operator = "script.execute_preset" | ||||
| preset_add_operator = "camera.preset_add" | preset_add_operator = "camera.preset_add" | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | ||||
| class SAFE_AREAS_PT_presets(PresetMenu): | class SAFE_AREAS_PT_presets(PresetMenu): | ||||
| bl_label = "Camera Presets" | bl_label = "Camera Presets" | ||||
| preset_subdir = "safe_areas" | preset_subdir = "safe_areas" | ||||
| preset_operator = "script.execute_preset" | preset_operator = "script.execute_preset" | ||||
| preset_add_operator = "safe_areas.preset_add" | preset_add_operator = "safe_areas.preset_add" | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | ||||
| 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_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ob = context.object | ob = context.object | ||||
| cam = context.camera | cam = context.camera | ||||
| space = context.space_data | space = context.space_data | ||||
| if ob: | if ob: | ||||
| layout.template_ID(ob, "data") | layout.template_ID(ob, "data") | ||||
| elif cam: | elif cam: | ||||
| layout.template_ID(space, "pin_id") | layout.template_ID(space, "pin_id") | ||||
| class DATA_PT_lens(CameraButtonsPanel, Panel): | class DATA_PT_lens(CameraButtonsPanel, Panel): | ||||
| bl_label = "Lens" | bl_label = "Lens" | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| cam = context.camera | cam = context.camera | ||||
| layout.prop(cam, "type") | layout.prop(cam, "type") | ||||
| Show All 24 Lines | def draw(self, context): | ||||
| col.prop(ccam, "fisheye_fov") | col.prop(ccam, "fisheye_fov") | ||||
| elif ccam.panorama_type == 'EQUIRECTANGULAR': | elif ccam.panorama_type == 'EQUIRECTANGULAR': | ||||
| sub = col.column(align=True) | sub = col.column(align=True) | ||||
| sub.prop(ccam, "latitude_min", text="Latitude Min") | sub.prop(ccam, "latitude_min", text="Latitude Min") | ||||
| sub.prop(ccam, "latitude_max", text="Max") | sub.prop(ccam, "latitude_max", text="Max") | ||||
| sub = col.column(align=True) | sub = col.column(align=True) | ||||
| sub.prop(ccam, "longitude_min", text="Longitude Min") | sub.prop(ccam, "longitude_min", text="Longitude Min") | ||||
| sub.prop(ccam, "longitude_max", text="Max") | sub.prop(ccam, "longitude_max", text="Max") | ||||
| elif engine in {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}: | elif engine in {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}: | ||||
| if cam.lens_unit == 'MILLIMETERS': | if cam.lens_unit == 'MILLIMETERS': | ||||
| col.prop(cam, "lens") | col.prop(cam, "lens") | ||||
| elif cam.lens_unit == 'FOV': | elif cam.lens_unit == 'FOV': | ||||
| col.prop(cam, "angle") | col.prop(cam, "angle") | ||||
| col.prop(cam, "lens_unit") | col.prop(cam, "lens_unit") | ||||
| col = layout.column() | col = layout.column() | ||||
| col.separator() | col.separator() | ||||
| sub = col.column(align=True) | sub = col.column(align=True) | ||||
| sub.prop(cam, "shift_x", text="Shift X") | sub.prop(cam, "shift_x", text="Shift X") | ||||
| sub.prop(cam, "shift_y", text="Y") | sub.prop(cam, "shift_y", text="Y") | ||||
| col.separator() | col.separator() | ||||
| sub = col.column(align=True) | sub = col.column(align=True) | ||||
| sub.prop(cam, "clip_start", text="Clip Start") | sub.prop(cam, "clip_start", text="Clip Start") | ||||
| sub.prop(cam, "clip_end", text="End") | sub.prop(cam, "clip_end", text="End") | ||||
| class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel): | class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel): | ||||
| bl_label = "Stereoscopy" | bl_label = "Stereoscopy" | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| render = context.scene.render | render = context.scene.render | ||||
| return (super().poll(context) and render.use_multiview and | return (super().poll(context) and render.use_multiview and | ||||
| render.views_format == 'STEREO_3D') | render.views_format == 'STEREO_3D') | ||||
| def draw(self, context): | def draw(self, context): | ||||
| Show All 32 Lines | def draw(self, context): | ||||
| col.active = not use_spherical_stereo | col.active = not use_spherical_stereo | ||||
| col.separator() | col.separator() | ||||
| col.prop(st, "pivot") | col.prop(st, "pivot") | ||||
| class DATA_PT_camera(CameraButtonsPanel, Panel): | class DATA_PT_camera(CameraButtonsPanel, Panel): | ||||
| bl_label = "Camera" | bl_label = "Camera" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | ||||
| def draw_header_preset(self, context): | def draw_header_preset(self, context): | ||||
| CAMERA_PT_presets.draw_panel_header(self.layout) | CAMERA_PT_presets.draw_panel_header(self.layout) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| cam = context.camera | cam = context.camera | ||||
| Show All 13 Lines | def draw(self, context): | ||||
| sub = col.column(align=True) | sub = col.column(align=True) | ||||
| sub.active = cam.sensor_fit == 'VERTICAL' | sub.active = cam.sensor_fit == 'VERTICAL' | ||||
| sub.prop(cam, "sensor_height", text="Height") | sub.prop(cam, "sensor_height", text="Height") | ||||
| class DATA_PT_camera_dof(CameraButtonsPanel, Panel): | class DATA_PT_camera_dof(CameraButtonsPanel, Panel): | ||||
| bl_label = "Depth of Field" | bl_label = "Depth of Field" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| cam = context.camera | cam = context.camera | ||||
| col = layout.column() | col = layout.column() | ||||
| Show All 24 Lines | def draw(self, context): | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(dof_options, "rotation") | col.prop(dof_options, "rotation") | ||||
| col.prop(dof_options, "ratio") | col.prop(dof_options, "ratio") | ||||
| class DATA_PT_camera_background_image(CameraButtonsPanel, Panel): | class DATA_PT_camera_background_image(CameraButtonsPanel, Panel): | ||||
| bl_label = "Background Images" | bl_label = "Background Images" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| cam = context.camera | cam = context.camera | ||||
| self.layout.prop(cam, "show_background_images", text="") | self.layout.prop(cam, "show_background_images", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| col.prop(bg, "use_flip_x") | col.prop(bg, "use_flip_x") | ||||
| col.prop(bg, "use_flip_y") | col.prop(bg, "use_flip_y") | ||||
| class DATA_PT_camera_display(CameraButtonsPanel, Panel): | class DATA_PT_camera_display(CameraButtonsPanel, Panel): | ||||
| bl_label = "Viewport Display" | bl_label = "Viewport Display" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| cam = context.camera | cam = context.camera | ||||
| split = layout.split() | split = layout.split() | ||||
| Show All 16 Lines | def draw(self, context): | ||||
| col.prop(cam, "show_mist", text="Mist") | col.prop(cam, "show_mist", text="Mist") | ||||
| 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") | ||||
| class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel): | class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel): | ||||
| bl_label = "Safe Areas" | bl_label = "Safe Areas" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| cam = context.camera | cam = context.camera | ||||
| self.layout.prop(cam, "show_safe_areas", text="") | self.layout.prop(cam, "show_safe_areas", text="") | ||||
| def draw_header_preset(self, context): | def draw_header_preset(self, context): | ||||
| SAFE_AREAS_PT_presets.draw_panel_header(self.layout) | SAFE_AREAS_PT_presets.draw_panel_header(self.layout) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| safe_data = context.scene.safe_areas | safe_data = context.scene.safe_areas | ||||
| camera = context.camera | camera = context.camera | ||||
| draw_display_safe_settings(layout, safe_data, camera) | draw_display_safe_settings(layout, safe_data, camera) | ||||
| class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, Panel): | class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, Panel): | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | ||||
| _context_path = "object.data" | _context_path = "object.data" | ||||
| _property_type = bpy.types.Camera | _property_type = bpy.types.Camera | ||||
| def draw_display_safe_settings(layout, safe_data, settings): | def draw_display_safe_settings(layout, safe_data, settings): | ||||
| show_safe_areas = settings.show_safe_areas | show_safe_areas = settings.show_safe_areas | ||||
| show_safe_center = settings.show_safe_center | show_safe_center = settings.show_safe_center | ||||
| Show All 38 Lines | |||||