[Bf-blender-cvs] [3fa8fad] viewport_experiments: Reuse focal length and sensor from camera

Antony Riakiotakis noreply at git.blender.org
Thu Feb 12 16:40:28 CET 2015


Commit: 3fa8fad5f1e998164fd3153c7056f811b42165a4
Author: Antony Riakiotakis
Date:   Thu Feb 12 15:43:41 2015 +0100
Branches: viewport_experiments
https://developer.blender.org/rB3fa8fad5f1e998164fd3153c7056f811b42165a4

Reuse focal length and sensor from camera

===================================================================

M	release/scripts/startup/bl_ui/properties_data_camera.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/blenkernel/intern/camera.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py
index 7cbcc4c..c2c9365 100644
--- a/release/scripts/startup/bl_ui/properties_data_camera.py
+++ b/release/scripts/startup/bl_ui/properties_data_camera.py
@@ -204,8 +204,6 @@ class DATA_PT_camera_gpu_dof(Panel):
         col = layout.column(align=True)
         col.label("Focus object or distance is set in Depth Of Field Panel")
         col.prop(dof_options, "fstop")
-        col.prop(dof_options, "focal_length")
-        col.prop(dof_options, "sensor")
 
     @classmethod
     def poll(cls, context):
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index d61ab8f..2ab7ac5 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -2941,7 +2941,7 @@ class VIEW3D_PT_view3d_shading(Panel):
                 if (view.region_3d.view_perspective == 'CAMERA'):
                     col.label("check dof properties in camera settings", icon='INFO')
                 else:
-                    dof_options = fx_options.dof_options
+                    dof_options = fx_options.dof
                     subcol = col.column(align=True)
                     subcol.prop(dof_options, "focus_distance")
                     subcol.prop(dof_options, "fstop")
@@ -2950,7 +2950,7 @@ class VIEW3D_PT_view3d_shading(Panel):
 
             col.prop(view, "ssao")
             if view.ssao:
-                ssao_options = fx_options.ssao_options
+                ssao_options = fx_options.ssao
                 subcol = col.column(align=True)
                 subcol.prop(ssao_options, "darkening")
                 subcol.prop(ssao_options, "distance_max")
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index 572eab4..118468f 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -697,6 +697,8 @@ void BKE_GPU_dof_from_camera(struct Object *camera, struct GPUFXOptions *options
 		Camera *cam = camera->data;
 		options->dof = &cam->gpu_dof;
 		options->dof->focal_length = cam->lens;
+		/* should probably use more magic here to get proper fit */
+		options->dof->sensor = cam->sensor_x;
 		if (cam->dof_ob) {
 			float vec[3];
 			sub_v3_v3v3(vec, cam->dof_ob->obmat[3], camera->obmat[3]);




More information about the Bf-blender-cvs mailing list