@@ -694,14 +694,14 @@ int BKE_layer_collection_findindex(ViewLayer *view_layer, const LayerCollection
694694 * in at least one layer collection. That list is also synchronized here, and
695695 * stores state like selection. */
696696
697- static short layer_collection_sync (ViewLayer * view_layer ,
698- const ListBase * lb_scene ,
699- ListBase * lb_layer ,
700- ListBase * new_object_bases ,
701- short parent_exclude ,
702- short parent_restrict ,
703- short parent_layer_restrict ,
704- unsigned short parent_local_collections_bits )
697+ static void layer_collection_sync (ViewLayer * view_layer ,
698+ const ListBase * lb_scene ,
699+ ListBase * lb_layer ,
700+ ListBase * new_object_bases ,
701+ short parent_exclude ,
702+ short parent_restrict ,
703+ short parent_layer_restrict ,
704+ unsigned short parent_local_collections_bits )
705705{
706706 /* TODO: support recovery after removal of intermediate collections, reordering, ..
707707 * For local edits we can make editing operating do the appropriate thing, but for
@@ -732,7 +732,6 @@ static short layer_collection_sync(ViewLayer *view_layer,
732732
733733 /* Add layer collections for any new scene collections, and ensure order is the same. */
734734 ListBase new_lb_layer = {NULL , NULL };
735- short runtime_flag = 0 ;
736735
737736 LISTBASE_FOREACH (const CollectionChild * , child , lb_scene ) {
738737 Collection * collection = child -> collection ;
@@ -763,23 +762,20 @@ static short layer_collection_sync(ViewLayer *view_layer,
763762 }
764763
765764 /* Sync child collections. */
766- short child_runtime_flag = layer_collection_sync (view_layer ,
767- & collection -> children ,
768- & lc -> layer_collections ,
769- new_object_bases ,
770- lc -> flag ,
771- child_restrict ,
772- child_layer_restrict ,
773- local_collections_bits );
765+ layer_collection_sync (view_layer ,
766+ & collection -> children ,
767+ & lc -> layer_collections ,
768+ new_object_bases ,
769+ lc -> flag ,
770+ child_restrict ,
771+ child_layer_restrict ,
772+ local_collections_bits );
774773
775774 /* Layer collection exclude is not inherited. */
775+ lc -> runtime_flag = 0 ;
776776 if (lc -> flag & LAYER_COLLECTION_EXCLUDE ) {
777- lc -> runtime_flag = 0 ;
778777 continue ;
779778 }
780- else {
781- lc -> runtime_flag = child_runtime_flag ;
782- }
783779
784780 /* We separate restrict viewport and visible view layer because a layer collection can be
785781 * hidden in the view layer yet (locally) visible in a viewport (if it is not restricted).*/
@@ -846,15 +842,11 @@ static short layer_collection_sync(ViewLayer *view_layer,
846842
847843 lc -> runtime_flag |= LAYER_COLLECTION_HAS_OBJECTS ;
848844 }
849-
850- runtime_flag |= lc -> runtime_flag ;
851845 }
852846
853847 /* Replace layer collection list with new one. */
854848 * lb_layer = new_lb_layer ;
855849 BLI_assert (BLI_listbase_count (lb_scene ) == BLI_listbase_count (lb_layer ));
856-
857- return runtime_flag ;
858850}
859851
860852/**
0 commit comments