diff options
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/extern/include/RE_engine.h | 1 | ||||
-rw-r--r-- | source/blender/render/intern/source/external_engine.c | 26 |
2 files changed, 25 insertions, 2 deletions
diff --git a/source/blender/render/extern/include/RE_engine.h b/source/blender/render/extern/include/RE_engine.h index 7c1bc4d12d6..b6c3668512b 100644 --- a/source/blender/render/extern/include/RE_engine.h +++ b/source/blender/render/extern/include/RE_engine.h @@ -56,6 +56,7 @@ struct Scene; #define RE_USE_PREVIEW 4 #define RE_USE_POSTPROCESS 8 #define RE_USE_SHADING_NODES 16 +#define RE_USE_EXCLUDE_LAYERS 32 /* RenderEngine.flag */ #define RE_ENGINE_ANIMATION 1 diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c index b76e67dd634..551f3686370 100644 --- a/source/blender/render/intern/source/external_engine.c +++ b/source/blender/render/intern/source/external_engine.c @@ -410,8 +410,30 @@ int RE_engine_render(Render *re, int do_all) /* update animation here so any render layer animation is applied before * creating the render result */ - if ((re->r.scemode & (R_NO_FRAME_UPDATE | R_BUTS_PREVIEW)) == 0) - BKE_scene_update_for_newframe(re->main, re->scene, re->lay); + if ((re->r.scemode & (R_NO_FRAME_UPDATE | R_BUTS_PREVIEW)) == 0) { + unsigned int lay = re->lay; + + /* don't update layers excluded on all render layers */ + if (type->flag & RE_USE_EXCLUDE_LAYERS) { + SceneRenderLayer *srl; + unsigned int non_excluded_lay = 0; + + if (re->r.scemode & R_SINGLE_LAYER) { + srl = BLI_findlink(&re->r.layers, re->r.actlay); + if (srl) + non_excluded_lay |= ~srl->lay_exclude; + } + else { + for (srl = re->r.layers.first; srl; srl = srl->next) + if (!(srl->layflag & SCE_LAY_DISABLE)) + non_excluded_lay |= ~srl->lay_exclude; + } + + lay &= non_excluded_lay; + } + + BKE_scene_update_for_newframe(re->main, re->scene, lay); + } /* create render result */ BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE); |