Differential D2927 Diff 9589 source/blender/depsgraph/intern/builder/deg_builder_relations_layer_collection.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/builder/deg_builder_relations_layer_collection.cc
| Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | |||||
| namespace DEG { | namespace DEG { | ||||
| void DepsgraphRelationBuilder::build_layer_collection( | void DepsgraphRelationBuilder::build_layer_collection( | ||||
| LayerCollection *layer_collection, | LayerCollection *layer_collection, | ||||
| LayerCollectionState *state) | LayerCollectionState *state) | ||||
| { | { | ||||
| OperationKey layer_key(&scene_->id, | OperationKey layer_key(&scene_->id, | ||||
| DEG_NODE_TYPE_LAYER_COLLECTIONS, | DEG_NODE_TYPE_LAYER_COLLECTIONS, | ||||
| DEG_OPCODE_SCENE_LAYER_EVAL, | DEG_OPCODE_VIEW_LAYER_EVAL, | ||||
| layer_collection->scene_collection->name, | layer_collection->scene_collection->name, | ||||
| state->index); | state->index); | ||||
| add_relation(state->prev_key, layer_key, "Layer collection order"); | add_relation(state->prev_key, layer_key, "Layer collection order"); | ||||
| ++state->index; | ++state->index; | ||||
| state->prev_key = layer_key; | state->prev_key = layer_key; | ||||
| /* Recurs into nested layer collections. */ | /* Recurs into nested layer collections. */ | ||||
| build_layer_collections(&layer_collection->layer_collections, state); | build_layer_collections(&layer_collection->layer_collections, state); | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_layer_collections( | void DepsgraphRelationBuilder::build_layer_collections( | ||||
| ListBase *layer_collections, | ListBase *layer_collections, | ||||
| LayerCollectionState *state) | LayerCollectionState *state) | ||||
| { | { | ||||
| LINKLIST_FOREACH (LayerCollection *, layer_collection, layer_collections) { | LINKLIST_FOREACH (LayerCollection *, layer_collection, layer_collections) { | ||||
| /* Recurs into the layer. */ | /* Recurs into the layer. */ | ||||
| build_layer_collection(layer_collection, state); | build_layer_collection(layer_collection, state); | ||||
| } | } | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_scene_layer_collections( | void DepsgraphRelationBuilder::build_view_layer_collections( | ||||
| SceneLayer *scene_layer) | ViewLayer *view_layer) | ||||
| { | { | ||||
| LayerCollectionState state; | LayerCollectionState state; | ||||
| state.index = 0; | state.index = 0; | ||||
| OperationKey init_key(&scene_->id, | OperationKey init_key(&scene_->id, | ||||
| DEG_NODE_TYPE_LAYER_COLLECTIONS, | DEG_NODE_TYPE_LAYER_COLLECTIONS, | ||||
| DEG_OPCODE_SCENE_LAYER_INIT, | DEG_OPCODE_VIEW_LAYER_INIT, | ||||
| scene_layer->name); | view_layer->name); | ||||
| OperationKey done_key(&scene_->id, | OperationKey done_key(&scene_->id, | ||||
| DEG_NODE_TYPE_LAYER_COLLECTIONS, | DEG_NODE_TYPE_LAYER_COLLECTIONS, | ||||
| DEG_OPCODE_SCENE_LAYER_DONE, | DEG_OPCODE_VIEW_LAYER_DONE, | ||||
| scene_layer->name); | view_layer->name); | ||||
| state.init_key = init_key; | state.init_key = init_key; | ||||
| state.done_key = done_key; | state.done_key = done_key; | ||||
| state.prev_key = init_key; | state.prev_key = init_key; | ||||
| build_layer_collections(&scene_layer->layer_collections, &state); | build_layer_collections(&view_layer->layer_collections, &state); | ||||
| add_relation(state.prev_key, done_key, "Layer collection order"); | add_relation(state.prev_key, done_key, "Layer collection order"); | ||||
| } | } | ||||
| } // namespace DEG | } // namespace DEG | ||||