diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-24 14:19:26 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-27 14:21:21 +0300 |
commit | 9b42b3e11462e96bf24970971ab181122c6b33df (patch) | |
tree | 07eb7bf0d3b0c8d9c428a7f080709a8c286c379c /source/blender/makesrna/intern/rna_camera.c | |
parent | 37fc23dd9e7738de7187e889f058cda845544ffb (diff) |
Sequencer: Add option to render OpenGL preview with DoF
The title says it all actually, controlled with DoF check box next to textured
solid check box.
Thanks Campbell for review!
Diffstat (limited to 'source/blender/makesrna/intern/rna_camera.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_camera.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 68cd2902acd..981ae75e7c5 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -39,8 +39,11 @@ #ifdef RNA_RUNTIME #include "BKE_camera.h" -#include "BKE_object.h" #include "BKE_depsgraph.h" +#include "BKE_object.h" +#include "BKE_sequencer.h" + +#include "WM_api.h" static float rna_Camera_angle_get(PointerRNA *ptr) { @@ -94,6 +97,14 @@ static void rna_Camera_dependency_update(Main *bmain, Scene *UNUSED(scene), Poin DAG_id_tag_update(&camera->id, 0); } +static void rna_Camera_dof_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) +{ + /* TODO(sergey): Can be more selective here. */ + BKE_sequencer_cache_cleanup(); + BKE_sequencer_preprocessed_cache_cleanup(); + WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); +} + #else static void rna_def_camera_stereo_data(BlenderRNA *brna) @@ -323,7 +334,7 @@ void RNA_def_camera(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0.0f, 5000.0f, 1, 2); RNA_def_property_ui_text(prop, "DOF Distance", "Distance to the focus point for depth of field"); - RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_dof_update"); /* Stereo Settings */ prop = RNA_def_property(srna, "stereo", PROP_POINTER, PROP_NONE); |