@@ -694,14 +694,14 @@ int BKE_layer_collection_findindex(ViewLayer *view_layer, const LayerCollection
694
694
* in at least one layer collection. That list is also synchronized here, and
695
695
* stores state like selection. */
696
696
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 )
705
705
{
706
706
/* TODO: support recovery after removal of intermediate collections, reordering, ..
707
707
* 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,
732
732
733
733
/* Add layer collections for any new scene collections, and ensure order is the same. */
734
734
ListBase new_lb_layer = {NULL , NULL };
735
- short runtime_flag = 0 ;
736
735
737
736
LISTBASE_FOREACH (const CollectionChild * , child , lb_scene ) {
738
737
Collection * collection = child -> collection ;
@@ -763,23 +762,20 @@ static short layer_collection_sync(ViewLayer *view_layer,
763
762
}
764
763
765
764
/* 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 );
774
773
775
774
/* Layer collection exclude is not inherited. */
775
+ lc -> runtime_flag = 0 ;
776
776
if (lc -> flag & LAYER_COLLECTION_EXCLUDE ) {
777
- lc -> runtime_flag = 0 ;
778
777
continue ;
779
778
}
780
- else {
781
- lc -> runtime_flag = child_runtime_flag ;
782
- }
783
779
784
780
/* We separate restrict viewport and visible view layer because a layer collection can be
785
781
* 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,
846
842
847
843
lc -> runtime_flag |= LAYER_COLLECTION_HAS_OBJECTS ;
848
844
}
849
-
850
- runtime_flag |= lc -> runtime_flag ;
851
845
}
852
846
853
847
/* Replace layer collection list with new one. */
854
848
* lb_layer = new_lb_layer ;
855
849
BLI_assert (BLI_listbase_count (lb_scene ) == BLI_listbase_count (lb_layer ));
856
-
857
- return runtime_flag ;
858
850
}
859
851
860
852
/**
0 commit comments