diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-12-28 17:24:10 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-12-28 17:24:13 +0300 |
commit | 70cdc8412c478b0446985ccbd55e48e65d31b672 (patch) | |
tree | 9d8e413ac0f3b5f4964b07854879a3f53e7a1f72 /source | |
parent | dfd7b0d07aab232e17fb851c8d61c9c64b9f455f (diff) |
Context: Fix scene_collection
We now allow for scene collection that is not currently linked to view layer.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/context.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index 7b7a7c8b7af..ea46d000344 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -968,11 +968,11 @@ RenderEngineType *CTX_data_engine_type(const bContext *C) LayerCollection *CTX_data_layer_collection(const bContext *C) { ViewLayer *view_layer = CTX_data_view_layer(C); - LayerCollection *lc; + LayerCollection *layer_collection; - if (ctx_data_pointer_verify(C, "layer_collection", (void *)&lc)) { - if (BKE_view_layer_has_collection(view_layer, lc->scene_collection)) { - return lc; + if (ctx_data_pointer_verify(C, "layer_collection", (void *)&layer_collection)) { + if (BKE_view_layer_has_collection(view_layer, layer_collection->scene_collection)) { + return layer_collection; } } @@ -982,16 +982,14 @@ LayerCollection *CTX_data_layer_collection(const bContext *C) SceneCollection *CTX_data_scene_collection(const bContext *C) { - SceneCollection *sc; - if (ctx_data_pointer_verify(C, "scene_collection", (void *)&sc)) { - if (BKE_view_layer_has_collection(CTX_data_view_layer(C), sc)) { - return sc; - } + SceneCollection *scene_collection; + if (ctx_data_pointer_verify(C, "scene_collection", (void *)&scene_collection)) { + return scene_collection; } - LayerCollection *lc = CTX_data_layer_collection(C); - if (lc) { - return lc->scene_collection; + LayerCollection *layer_collection = CTX_data_layer_collection(C); + if (layer_collection) { + return layer_collection->scene_collection; } /* fallback */ |