Fix depsgrah copying and evaluating hidden collections.
This commit is contained in:
parent
1e6108e972
commit
9948e26e14
Notes:
blender-bot
2023-02-21 17:59:30 +01:00
Referenced by issue #55228, Performance regression of production file
|
@ -424,6 +424,13 @@ void DepsgraphNodeBuilder::build_collection(Collection *collection)
|
|||
if (built_map_.checkIsBuiltAndTag(collection)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ?
|
||||
COLLECTION_RESTRICT_VIEW : COLLECTION_RESTRICT_RENDER;
|
||||
if (collection->flag & restrict_flag) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Build collection objects. */
|
||||
LISTBASE_FOREACH (CollectionObject *, cob, &collection->gobject) {
|
||||
build_object(-1, cob->ob, DEG_ID_LINKED_INDIRECTLY);
|
||||
|
|
|
@ -67,9 +67,17 @@ namespace DEG {
|
|||
|
||||
void DepsgraphNodeBuilder::build_layer_collections(ListBase *lb)
|
||||
{
|
||||
const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ?
|
||||
COLLECTION_RESTRICT_VIEW : COLLECTION_RESTRICT_RENDER;
|
||||
|
||||
for (LayerCollection *lc = (LayerCollection *)lb->first; lc; lc = lc->next) {
|
||||
build_collection(lc->collection);
|
||||
build_layer_collections(&lc->layer_collections);
|
||||
if (!(lc->collection->flag & restrict_flag)) {
|
||||
if (!(lc->flag & LAYER_COLLECTION_EXCLUDE)) {
|
||||
build_collection(lc->collection);
|
||||
}
|
||||
|
||||
build_layer_collections(&lc->layer_collections);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -427,6 +427,12 @@ void DepsgraphRelationBuilder::build_id(ID *id)
|
|||
|
||||
void DepsgraphRelationBuilder::build_collection(Object *object, Collection *collection)
|
||||
{
|
||||
const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ?
|
||||
COLLECTION_RESTRICT_VIEW : COLLECTION_RESTRICT_RENDER;
|
||||
if (collection->flag & restrict_flag) {
|
||||
return;
|
||||
}
|
||||
|
||||
const bool group_done = built_map_.checkIsBuiltAndTag(collection);
|
||||
OperationKey object_local_transform_key(object != NULL ? &object->id : NULL,
|
||||
DEG_NODE_TYPE_TRANSFORM,
|
||||
|
|
|
@ -71,9 +71,17 @@ namespace DEG {
|
|||
|
||||
void DepsgraphRelationBuilder::build_layer_collections(ListBase *lb)
|
||||
{
|
||||
const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ?
|
||||
COLLECTION_RESTRICT_VIEW : COLLECTION_RESTRICT_RENDER;
|
||||
|
||||
for (LayerCollection *lc = (LayerCollection *)lb->first; lc; lc = lc->next) {
|
||||
build_collection(NULL, lc->collection);
|
||||
build_layer_collections(&lc->layer_collections);
|
||||
if (!(lc->collection->flag & restrict_flag)) {
|
||||
if (!(lc->flag & LAYER_COLLECTION_EXCLUDE)) {
|
||||
build_collection(NULL, lc->collection);
|
||||
}
|
||||
|
||||
build_layer_collections(&lc->layer_collections);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue