[Bf-blender-cvs] [cfaea24117f] blender2.8: Fix T55754: DOF with new Camera is not working

Clément Foucault noreply at git.blender.org
Tue Jul 24 18:05:36 CEST 2018


Commit: cfaea24117f2ef3f1e2ce9bc0ebd620c27bfeba5
Author: Clément Foucault
Date:   Tue Jul 24 17:57:24 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBcfaea24117f2ef3f1e2ce9bc0ebd620c27bfeba5

Fix T55754: DOF with new Camera is not working

Was due to non initialized gpu_dof.ratio

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

M	source/blender/blenkernel/intern/camera.c
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index 4203e0455f8..87b65601534 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -76,6 +76,9 @@ void BKE_camera_init(Camera *cam)
 	cam->flag |= CAM_SHOWPASSEPARTOUT;
 	cam->passepartalpha = 0.5f;
 
+	cam->gpu_dof.fstop = 128.0f;
+	cam->gpu_dof.ratio = 1.0f;
+
 	/* stereoscopy 3d */
 	cam->stereo.interocular_distance = 0.065f;
 	cam->stereo.convergence_distance = 30.f * 0.065f;
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 096a2d7b8dc..b666b15015a 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -4092,6 +4092,7 @@ static void rna_def_gpu_dof_fx(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "fstop", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_ui_text(prop, "F-stop", "F-stop for dof effect");
+	RNA_def_property_float_default(prop, 128.0f);
 	RNA_def_property_range(prop, 0.0f, FLT_MAX);
 	RNA_def_property_ui_range(prop, 0.1f, 128.0f, 10, 1);
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPUDOFSettings_update");
@@ -4110,6 +4111,7 @@ static void rna_def_gpu_dof_fx(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "ratio", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_ui_text(prop, "Ratio", "Distortion to simulate anamorphic lens bokeh");
+	RNA_def_property_float_default(prop, 1.0f);
 	RNA_def_property_range(prop, 0.0000001f, FLT_MAX);
 	RNA_def_property_ui_range(prop, 1.0f, 2.0f, 0.1, 3);
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);



More information about the Bf-blender-cvs mailing list