Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/layer.c
| Show First 20 Lines • Show All 739 Lines • ▼ Show 20 Lines | for (CollectionObject *cob = collection->gobject.first; cob; cob = cob->next) { | ||||
| if (lc->flag & LAYER_COLLECTION_HOLDOUT) { | if (lc->flag & LAYER_COLLECTION_HOLDOUT) { | ||||
| base->flag_from_collection |= BASE_HOLDOUT; | base->flag_from_collection |= BASE_HOLDOUT; | ||||
| } | } | ||||
| if (lc->flag & LAYER_COLLECTION_INDIRECT_ONLY) { | if (lc->flag & LAYER_COLLECTION_INDIRECT_ONLY) { | ||||
| base->flag_from_collection |= BASE_INDIRECT_ONLY; | base->flag_from_collection |= BASE_INDIRECT_ONLY; | ||||
| } | } | ||||
| lc->runtime_flag |= LAYER_COLLECTION_HAS_OBJECTS; | lc->runtime_flag |= LAYER_COLLECTION_HAS_OBJECTS; | ||||
| /* Make sure flags on base are usable right away. */ | |||||
| BKE_base_eval_flags(base); | |||||
| } | } | ||||
| runtime_flag |= lc->runtime_flag; | runtime_flag |= lc->runtime_flag; | ||||
| } | } | ||||
| /* Replace layer collection list with new one. */ | /* Replace layer collection list with new one. */ | ||||
| *lb_layer = new_lb_layer; | *lb_layer = new_lb_layer; | ||||
| BLI_assert(BLI_listbase_count(lb_scene) == BLI_listbase_count(lb_layer)); | BLI_assert(BLI_listbase_count(lb_scene) == BLI_listbase_count(lb_layer)); | ||||
| ▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | for (Base *base = view_layer->object_bases.first; base; base = base->next) { | ||||
| if (base->object) { | if (base->object) { | ||||
| BLI_ghash_remove(view_layer->object_bases_hash, base->object, NULL, NULL); | BLI_ghash_remove(view_layer->object_bases_hash, base->object, NULL, NULL); | ||||
| } | } | ||||
| } | } | ||||
| BLI_freelistN(&view_layer->object_bases); | BLI_freelistN(&view_layer->object_bases); | ||||
| view_layer->object_bases = new_object_bases; | view_layer->object_bases = new_object_bases; | ||||
| for (Base *base = view_layer->object_bases.first; base; base = base->next) { | |||||
| BKE_base_eval_flags(base); | |||||
| } | |||||
| /* Always set a valid active collection. */ | /* Always set a valid active collection. */ | ||||
| LayerCollection *active = view_layer->active_collection; | LayerCollection *active = view_layer->active_collection; | ||||
| if (active && (active->flag & LAYER_COLLECTION_EXCLUDE)) { | if (active && (active->flag & LAYER_COLLECTION_EXCLUDE)) { | ||||
| BKE_layer_collection_activate_parent(view_layer, active); | BKE_layer_collection_activate_parent(view_layer, active); | ||||
| } | } | ||||
| else if (active == NULL) { | else if (active == NULL) { | ||||
| view_layer->active_collection = view_layer->layer_collections.first; | view_layer->active_collection = view_layer->layer_collections.first; | ||||
| ▲ Show 20 Lines • Show All 691 Lines • Show Last 20 Lines | |||||