diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2019-05-17 17:57:31 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-17 18:59:26 +0300 |
commit | bc3139d79226896cf6c2b0813a1188eda70fad09 (patch) | |
tree | e5c7f1f878b4769def10e2ddbc75aacebda4afd5 /intern/cycles/blender/addon | |
parent | 043299ab69ca47a42fc8ca4f629727f8a6a2dd31 (diff) |
Cycles/Eevee: unify depth of field settings for cameras
There is now a checkbox to enable/disable depth of field per camera. For Eevee
this replace the scene level setting. For Cycles there is now only an F-Stop
value, no longer a Radius.
Existing files are converted based on Cycles or Eevee being set in the scene.
Differential Revision: https://developer.blender.org/D4882
Diffstat (limited to 'intern/cycles/blender/addon')
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 48 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 55 |
2 files changed, 17 insertions, 86 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 35f9e17dc41..d9e145c8b75 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -68,11 +68,6 @@ enum_filter_types = ( ('BLACKMAN_HARRIS', "Blackman-Harris", "Blackman-Harris filter"), ) -enum_aperture_types = ( - ('RADIUS', "Radius", "Directly change the size of the aperture"), - ('FSTOP', "F-stop", "Change the size of the aperture by f-stop"), -) - enum_panorama_types = ( ('EQUIRECTANGULAR', "Equirectangular", "Render the scene with a spherical camera, also known as Lat Long panorama"), ('FISHEYE_EQUIDISTANT', "Fisheye Equidistant", "Ideal for fulldomes, ignore the sensor dimensions"), @@ -742,49 +737,6 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): class CyclesCameraSettings(bpy.types.PropertyGroup): - aperture_type: EnumProperty( - name="Aperture Type", - description="Use f-stop number or aperture radius", - items=enum_aperture_types, - default='RADIUS', - ) - aperture_fstop: FloatProperty( - name="Aperture f-stop", - description="F-stop ratio (lower numbers give more defocus, higher numbers give a sharper image)", - min=0.0, soft_min=0.1, soft_max=64.0, - default=5.6, - step=10, - precision=1, - ) - aperture_size: FloatProperty( - name="Aperture Size", - description="Radius of the aperture for depth of field (higher values give more defocus)", - min=0.0, soft_max=10.0, - default=0.0, - step=1, - precision=4, - subtype='DISTANCE', - ) - aperture_blades: IntProperty( - name="Aperture Blades", - description="Number of blades in aperture for polygonal bokeh (at least 3)", - min=0, max=100, - default=0, - ) - aperture_rotation: FloatProperty( - name="Aperture Rotation", - description="Rotation of blades in aperture", - soft_min=-pi, soft_max=pi, - subtype='ANGLE', - default=0, - ) - aperture_ratio: FloatProperty( - name="Aperture Ratio", - description="Distortion to simulate anamorphic lens bokeh", - min=0.01, soft_min=1.0, soft_max=2.0, - default=1.0, - precision=4, - ) panorama_type: EnumProperty( name="Panorama Type", description="Distortion to use for the calculation", diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 86f58769025..80b4159f2ec 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -1016,20 +1016,27 @@ class CYCLES_CAMERA_PT_dof(CyclesButtonsPanel, Panel): def poll(cls, context): return context.camera and CyclesButtonsPanel.poll(context) + def draw_header(self, context): + cam = context.camera + dof = cam.dof + self.layout.prop(dof, "use_dof", text="") + def draw(self, context): layout = self.layout layout.use_property_split = True cam = context.camera + dof = cam.dof + layout.active = dof.use_dof split = layout.split() col = split.column() - col.prop(cam, "dof_object", text="Focus Object") + col.prop(dof, "focus_object", text="Focus Object") sub = col.row() - sub.active = cam.dof_object is None - sub.prop(cam, "dof_distance", text="Distance") + sub.active = dof.focus_object is None + sub.prop(dof, "focus_distance", text="Distance") class CYCLES_CAMERA_PT_dof_aperture(CyclesButtonsPanel, Panel): @@ -1043,44 +1050,17 @@ class CYCLES_CAMERA_PT_dof_aperture(CyclesButtonsPanel, Panel): def draw(self, context): layout = self.layout layout.use_property_split = True - flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) cam = context.camera - ccam = cam.cycles - - col = flow.column() - col.prop(ccam, "aperture_type") - if ccam.aperture_type == 'RADIUS': - col.prop(ccam, "aperture_size", text="Size") - elif ccam.aperture_type == 'FSTOP': - col.prop(ccam, "aperture_fstop", text="Number") - col.separator() - - col = flow.column() - col.prop(ccam, "aperture_blades", text="Blades") - col.prop(ccam, "aperture_rotation", text="Rotation") - col.prop(ccam, "aperture_ratio", text="Ratio") - - -class CYCLES_CAMERA_PT_dof_viewport(CyclesButtonsPanel, Panel): - bl_label = "Viewport" - bl_parent_id = "CYCLES_CAMERA_PT_dof" - - @classmethod - def poll(cls, context): - return context.camera and CyclesButtonsPanel.poll(context) - - def draw(self, context): - layout = self.layout - layout.use_property_split = True + dof = cam.dof + layout.active = dof.use_dof flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) - cam = context.camera - dof_options = cam.gpu_dof - - sub = flow.column(align=True) - sub.prop(dof_options, "fstop") - sub.prop(dof_options, "blades") + col = flow.column() + col.prop(dof, "aperture_fstop") + col.prop(dof, "aperture_blades") + col.prop(dof, "aperture_rotation") + col.prop(dof, "aperture_ratio") class CYCLES_PT_context_material(CyclesButtonsPanel, Panel): @@ -2147,7 +2127,6 @@ classes = ( CYCLES_PT_post_processing, CYCLES_CAMERA_PT_dof, CYCLES_CAMERA_PT_dof_aperture, - CYCLES_CAMERA_PT_dof_viewport, CYCLES_PT_context_material, CYCLES_OBJECT_PT_motion_blur, CYCLES_OBJECT_PT_cycles_settings, |