diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-11 13:36:50 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-12 12:05:18 +0300 |
commit | 9c406b786faea9fee6489f0a1a21cab42a3d5cf3 (patch) | |
tree | 7c8b69137bcb474556336f80046f01f51cfb483e /source/blender/blenkernel/intern/layer.c | |
parent | ca2484e09005207e7bad90f484de6cbba1013833 (diff) |
Depsgraph: Bind view layer by index
Makes it a bit slower to evaluate single view layer, but this is does not
happen often, and overall number of layers is not very high.
Diffstat (limited to 'source/blender/blenkernel/intern/layer.c')
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 8e53dea0c24..4d3b4e43043 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -2385,7 +2385,7 @@ static void layer_eval_collections_recurse(const EvaluationContext *eval_ctx, void BKE_layer_eval_view_layer(const struct EvaluationContext *eval_ctx, struct ID *owner_id, - struct ViewLayer *view_layer) + ViewLayer *view_layer) { layer_eval_layer_collection_pre(owner_id, view_layer); layer_eval_collections_recurse(eval_ctx, @@ -2394,6 +2394,18 @@ void BKE_layer_eval_view_layer(const struct EvaluationContext *eval_ctx, layer_eval_layer_collection_post(view_layer); } +void BKE_layer_eval_view_layer_indexed(const struct EvaluationContext *eval_ctx, + struct ID *owner_id, + int view_layer_index) +{ + BLI_assert(GS(owner_id->name) == ID_SCE); + BLI_assert(view_layer_index >= 0); + Scene *scene = (Scene *)owner_id; + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, view_layer_index); + BLI_assert(view_layer != NULL); + BKE_layer_eval_view_layer(eval_ctx, owner_id, view_layer); +} + /** * Free any static allocated memory. */ |