diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-11-10 03:54:58 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-11-10 03:54:58 +0400 |
commit | 7d03e5c615a71fea9223d4fa4fb3bf4e98190c8c (patch) | |
tree | 01185f99ff6e3cfbaa2a6e4f968809f645daf1bb /source/blender/makesrna | |
parent | 5a29885007c66752adbdcd62cdac5e7749f083fd (diff) |
Fix part of #33132: render resoltuion refresh issues after persistent images
was added for cycles.
This fixes the case where the option is disabled. I moved the option now to
Blender itself and made it keep the engine around only when it's enabled. Also
fixes case where there could be issues when switching to another renderer.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index b102d463195..5e4eb526b76 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1254,6 +1254,12 @@ static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr rna_Scene_use_simplify_update(bmain, scene, ptr); } +static void rna_Scene_use_persistent_data_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr)) +{ + if (!(scene->r.mode & R_PERSISTENT_DATA)) + RE_FreePersistentData(); +} + static int rna_Scene_use_audio_get(PointerRNA *ptr) { Scene *scene = (Scene *)ptr->data; @@ -4036,6 +4042,12 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", R_SIMPLE_NO_TRIANGULATE); RNA_def_property_ui_text(prop, "Skip Quad to Triangles", "Disable non-planar quads being triangulated"); + /* persistent data */ + prop = RNA_def_property(srna, "use_persistent_data", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "mode", R_PERSISTENT_DATA); + RNA_def_property_ui_text(prop, "Persistent Data", "Keep render data around for faster re-renders"); + RNA_def_property_update(prop, 0, "rna_Scene_use_persistent_data_update"); + /* Scene API */ RNA_api_scene_render(srna); } |