Differential D3383 Diff 10966 source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
| Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | |||||
| #include "intern/nodes/deg_node_component.h" | #include "intern/nodes/deg_node_component.h" | ||||
| #include "intern/nodes/deg_node_operation.h" | #include "intern/nodes/deg_node_operation.h" | ||||
| #include "intern/depsgraph_types.h" | #include "intern/depsgraph_types.h" | ||||
| #include "intern/depsgraph_intern.h" | #include "intern/depsgraph_intern.h" | ||||
| #include "util/deg_util_foreach.h" | #include "util/deg_util_foreach.h" | ||||
| namespace DEG { | namespace DEG { | ||||
| void DepsgraphNodeBuilder::build_layer_collections(ListBase *lb) | |||||
| { | |||||
| for (LayerCollection *lc = (LayerCollection *)lb->first; lc; lc = lc->next) { | |||||
| build_collection(lc->collection); | |||||
| build_layer_collections(&lc->layer_collections); | |||||
| } | |||||
| } | |||||
| void DepsgraphNodeBuilder::build_view_layer( | void DepsgraphNodeBuilder::build_view_layer( | ||||
| Scene *scene, | Scene *scene, | ||||
| ViewLayer *view_layer, | ViewLayer *view_layer, | ||||
| eDepsNode_LinkedState_Type linked_state) | eDepsNode_LinkedState_Type linked_state) | ||||
| { | { | ||||
| view_layer_index_ = BLI_findindex(&scene->view_layers, view_layer); | view_layer_index_ = BLI_findindex(&scene->view_layers, view_layer); | ||||
| BLI_assert(view_layer_index_ != -1); | BLI_assert(view_layer_index_ != -1); | ||||
| /* Scene ID block. */ | /* Scene ID block. */ | ||||
| Show All 19 Lines | void DepsgraphNodeBuilder::build_view_layer( | ||||
| */ | */ | ||||
| int base_index = 0; | int base_index = 0; | ||||
| LISTBASE_FOREACH(Base *, base, &view_layer->object_bases) { | LISTBASE_FOREACH(Base *, base, &view_layer->object_bases) { | ||||
| /* object itself */ | /* object itself */ | ||||
| build_object(base_index, base->object, linked_state); | build_object(base_index, base->object, linked_state); | ||||
| base->object->select_color = select_color++; | base->object->select_color = select_color++; | ||||
| ++base_index; | ++base_index; | ||||
| } | } | ||||
| build_layer_collections(&view_layer->layer_collections); | |||||
| if (scene->camera != NULL) { | if (scene->camera != NULL) { | ||||
| build_object(-1, scene->camera, DEG_ID_LINKED_INDIRECTLY); | build_object(-1, scene->camera, DEG_ID_LINKED_INDIRECTLY); | ||||
| } | } | ||||
| /* Rigidbody. */ | /* Rigidbody. */ | ||||
| if (scene->rigidbody_world != NULL) { | if (scene->rigidbody_world != NULL) { | ||||
| build_rigidbody(scene); | build_rigidbody(scene); | ||||
| } | } | ||||
| /* Scene's animation and drivers. */ | /* Scene's animation and drivers. */ | ||||
| Show All 24 Lines | void DepsgraphNodeBuilder::build_view_layer( | ||||
| LISTBASE_FOREACH (MovieClip *, clip, &bmain_->movieclip) { | LISTBASE_FOREACH (MovieClip *, clip, &bmain_->movieclip) { | ||||
| build_movieclip(clip); | build_movieclip(clip); | ||||
| } | } | ||||
| /* Collections. */ | /* Collections. */ | ||||
| add_operation_node(&scene->id, | add_operation_node(&scene->id, | ||||
| DEG_NODE_TYPE_LAYER_COLLECTIONS, | DEG_NODE_TYPE_LAYER_COLLECTIONS, | ||||
| function_bind(BKE_layer_eval_view_layer_indexed, | function_bind(BKE_layer_eval_view_layer_indexed, | ||||
| _1, | _1, | ||||
| &scene_cow->id, | scene_cow, | ||||
| view_layer_index_), | view_layer_index_), | ||||
| DEG_OPCODE_VIEW_LAYER_EVAL); | DEG_OPCODE_VIEW_LAYER_EVAL); | ||||
| /* Parameters evaluation for scene relations mainly. */ | /* Parameters evaluation for scene relations mainly. */ | ||||
| add_operation_node(&scene->id, | add_operation_node(&scene->id, | ||||
| DEG_NODE_TYPE_PARAMETERS, | DEG_NODE_TYPE_PARAMETERS, | ||||
| NULL, | NULL, | ||||
| DEG_OPCODE_PLACEHOLDER, | DEG_OPCODE_PLACEHOLDER, | ||||
| "Scene Eval"); | "Scene Eval"); | ||||
| /* Build all set scenes. */ | /* Build all set scenes. */ | ||||
| if (scene->set != NULL) { | if (scene->set != NULL) { | ||||
| ViewLayer *set_view_layer = BKE_view_layer_default_render(scene->set); | ViewLayer *set_view_layer = BKE_view_layer_default_render(scene->set); | ||||
| build_view_layer(scene->set, set_view_layer, DEG_ID_LINKED_VIA_SET); | build_view_layer(scene->set, set_view_layer, DEG_ID_LINKED_VIA_SET); | ||||
| } | } | ||||
| } | } | ||||
| } // namespace DEG | } // namespace DEG | ||||