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 /source/blender/makesrna/intern/rna_scene.c | |
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 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 114 |
1 files changed, 0 insertions, 114 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 4584cadb51d..a4d263b7927 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2155,45 +2155,6 @@ void rna_FreestyleSettings_module_remove(ID *id, WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL); } -char *rna_GPUDOF_path(PointerRNA *ptr) -{ - /* if there is ID-data, resolve the path using the index instead of by name, - * since the name used is the name of the texture assigned, but the texture - * may be used multiple times in the same stack - */ - if (ptr->id.data) { - if (GS(((ID *)ptr->id.data)->name) == ID_CA) { - return BLI_strdup("gpu_dof"); - } - } - - return BLI_strdup(""); -} - -static void rna_GPUDOFSettings_blades_set(PointerRNA *ptr, const int value) -{ - GPUDOFSettings *dofsettings = (GPUDOFSettings *)ptr->data; - - if (value == 1 || value == 2) { - if (dofsettings->num_blades == 0) { - dofsettings->num_blades = 3; - } - else { - dofsettings->num_blades = 0; - } - } - else { - dofsettings->num_blades = value; - } -} - -static void rna_GPUDOFSettings_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr)) -{ - /* TODO(sergey): Can be more selective here. */ - BKE_sequencer_cache_cleanup_all(bmain); - WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); -} - static void rna_Stereo3dFormat_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { ID *id = ptr->id.data; @@ -4734,60 +4695,6 @@ static void rna_def_bake_data(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); } -static void rna_def_gpu_dof_fx(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "GPUDOFSettings", NULL); - RNA_def_struct_ui_text(srna, "GPU DOF", "Settings for GPU based depth of field"); - RNA_def_struct_path_func(srna, "rna_GPUDOF_path"); - - prop = RNA_def_property(srna, "focus_distance", PROP_FLOAT, PROP_DISTANCE); - RNA_def_property_ui_text(prop, "Focus distance", "Viewport depth of field focus distance"); - RNA_def_property_range(prop, 0.0f, FLT_MAX); - RNA_def_property_ui_range(prop, 0.0f, 5000.0f, 1, 2); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPUDOFSettings_update"); - - prop = RNA_def_property(srna, "focal_length", PROP_FLOAT, PROP_DISTANCE_CAMERA); - RNA_def_property_ui_text(prop, "Focal Length", "Focal length for dof effect"); - RNA_def_property_range(prop, 1.0f, FLT_MAX); - RNA_def_property_ui_range(prop, 1.0f, 5000.0f, 1, 2); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPUDOFSettings_update"); - - prop = RNA_def_property(srna, "sensor", PROP_FLOAT, PROP_DISTANCE_CAMERA); - RNA_def_property_ui_text(prop, "Sensor", "Size of sensor"); - RNA_def_property_range(prop, 1.0f, FLT_MAX); - RNA_def_property_ui_range(prop, 1.0f, 5000.0f, 1, 2); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPUDOFSettings_update"); - - 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"); - - prop = RNA_def_property(srna, "blades", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "num_blades"); - RNA_def_property_ui_text(prop, "Blades", "Blades for dof effect"); - RNA_def_property_range(prop, 0, 16); - RNA_def_property_int_funcs(prop, NULL, "rna_GPUDOFSettings_blades_set", NULL); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPUDOFSettings_update"); - - prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_ui_text(prop, "Rotation", "Rotation of blades in aperture"); - RNA_def_property_range(prop, -M_PI, M_PI); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - - 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.01f, 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); -} - static void rna_def_gpu_ssao_fx(BlenderRNA *brna) { StructRNA *srna; @@ -4832,23 +4739,10 @@ static void rna_def_gpu_fx(BlenderRNA *brna) PropertyRNA *prop; rna_def_gpu_ssao_fx(brna); - rna_def_gpu_dof_fx(brna); srna = RNA_def_struct(brna, "GPUFXSettings", NULL); RNA_def_struct_ui_text(srna, "GPU FX Settings", "Settings for GPU based compositing"); - prop = RNA_def_property(srna, "dof", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_struct_type(prop, "GPUDOFSettings"); - RNA_def_property_ui_text(prop, "Depth Of Field settings", ""); - - prop = RNA_def_property(srna, "use_dof", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "fx_flag", GPU_FX_FLAG_DOF); - RNA_def_property_ui_text(prop, - "Depth Of Field", - "Use depth of field on viewport using the values from active camera"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - prop = RNA_def_property(srna, "ssao", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "GPUSSAOSettings"); @@ -7004,14 +6898,6 @@ static void rna_def_scene_eevee(BlenderRNA *brna) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); /* Depth of Field */ - prop = RNA_def_property(srna, "use_dof", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_DOF_ENABLED); - RNA_def_property_boolean_default(prop, 0); - RNA_def_property_ui_text( - prop, "Depth of Field", "Enable depth of field using the values from the active camera"); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); - RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - prop = RNA_def_property(srna, "bokeh_max_size", PROP_FLOAT, PROP_PIXEL); RNA_def_property_float_default(prop, 100.0f); RNA_def_property_ui_text( |