diff options
Diffstat (limited to 'source/blender/editors/render')
-rw-r--r-- | source/blender/editors/render/render_update.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c index fb9d11feb63..6db148eb4e1 100644 --- a/source/blender/editors/render/render_update.c +++ b/source/blender/editors/render/render_update.c @@ -23,6 +23,7 @@ #include <stdlib.h> #include <string.h> +#include "DNA_cachefile_types.h" #include "DNA_light_types.h" #include "DNA_material_types.h" #include "DNA_node_types.h" @@ -204,6 +205,19 @@ void ED_render_engine_changed(Main *bmain, const bool update_scene_data) ntreeCompositUpdateRLayers(scene->nodetree); } } + + /* Update CacheFiles to ensure that procedurals are properly taken into account. */ + LISTBASE_FOREACH (CacheFile *, cachefile, &bmain->cachefiles) { + /* Only update cachefiles which are set to use a render procedural. We do not use + * BKE_cachefile_uses_render_procedural here as we need to update regardless of the current + * engine or its settings. */ + if (cachefile->use_render_procedural) { + DEG_id_tag_update(&cachefile->id, ID_RECALC_COPY_ON_WRITE); + /* Rebuild relations so that modifiers are reconnected to or disconnected from the cachefile. + */ + DEG_relations_tag_update(bmain); + } + } } void ED_render_view_layer_changed(Main *bmain, bScreen *screen) |