diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_layer.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 17 |
2 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_layer.h b/source/blender/blenkernel/BKE_layer.h index 8cfc9ef8be9..88a340b11a7 100644 --- a/source/blender/blenkernel/BKE_layer.h +++ b/source/blender/blenkernel/BKE_layer.h @@ -585,6 +585,9 @@ struct LayerCollection *BKE_view_layer_active_collection_get(struct ViewLayer *v void BKE_view_layer_need_resync_tag(struct ViewLayer *view_layer); void BKE_view_layer_synced_ensure(const struct Scene *scene, struct ViewLayer *view_layer); +void BKE_scene_view_layers_synced_ensure(const struct Scene *scene); +void BKE_main_view_layers_synced_ensure(const struct Main *bmain); + struct ViewLayerAOV *BKE_view_layer_add_aov(struct ViewLayer *view_layer); void BKE_view_layer_remove_aov(struct ViewLayer *view_layer, struct ViewLayerAOV *aov); void BKE_view_layer_set_active_aov(struct ViewLayer *view_layer, struct ViewLayerAOV *aov); diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 12472cf9dc5..fe11dc99bac 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -975,6 +975,23 @@ void BKE_view_layer_synced_ensure(const Scene *scene, struct ViewLayer *view_lay } } +void BKE_scene_view_layers_synced_ensure(const Scene *scene) +{ + LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) { + BKE_view_layer_synced_ensure(scene, view_layer); + } +} + +void BKE_main_view_layers_synced_ensure(const Main *bmain) +{ + for (const Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { + BKE_scene_view_layers_synced_ensure(scene); + } + + /* NOTE: This is not (yet?) covered by the dirty tag and deffered resync system */ + BKE_layer_collection_local_sync_all(bmain); +} + static void layer_collection_objects_sync(ViewLayer *view_layer, LayerCollection *layer, ListBase *r_lb_new_object_bases, |