Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/depsgraph_tag.cc
| Show First 20 Lines • Show All 494 Lines • ▼ Show 20 Lines | for (ComponentNode *comp_node : id_node->components.values()) { | ||||
| if (comp_node->type == NodeType::ANIMATION) { | if (comp_node->type == NodeType::ANIMATION) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| comp_node->tag_update(graph, update_source); | comp_node->tag_update(graph, update_source); | ||||
| } | } | ||||
| deg_graph_id_tag_legacy_compat(bmain, graph, id, (IDRecalcFlag)0, update_source); | deg_graph_id_tag_legacy_compat(bmain, graph, id, (IDRecalcFlag)0, update_source); | ||||
| } | } | ||||
| void deg_graph_on_visible_update(Main *bmain, Depsgraph *graph, const bool do_time) | void graph_tag_on_visible_update(Depsgraph *graph, const bool do_time) | ||||
| { | { | ||||
| graph->need_visibility_update = true; | |||||
| graph->need_visibility_time_update |= do_time; | |||||
| } | |||||
| } /* namespace */ | |||||
| void graph_tag_ids_for_visible_update(Depsgraph *graph) | |||||
| { | |||||
| if (!graph->need_visibility_update) { | |||||
| return; | |||||
| } | |||||
| const bool do_time = graph->need_visibility_time_update; | |||||
| Main *bmain = graph->bmain; | |||||
| /* NOTE: It is possible to have this function called with `do_time=false` first and later (prior | /* NOTE: It is possible to have this function called with `do_time=false` first and later (prior | ||||
| * to evaluation though) with `do_time=true`. This means early output checks should be aware of | * to evaluation though) with `do_time=true`. This means early output checks should be aware of | ||||
| * this. */ | * this. */ | ||||
| for (deg::IDNode *id_node : graph->id_nodes) { | for (deg::IDNode *id_node : graph->id_nodes) { | ||||
| const ID_Type id_type = GS(id_node->id_orig->name); | const ID_Type id_type = GS(id_node->id_orig->name); | ||||
| if (id_type == ID_OB) { | if (id_type == ID_OB) { | ||||
| Object *object_orig = reinterpret_cast<Object *>(id_node->id_orig); | Object *object_orig = reinterpret_cast<Object *>(id_node->id_orig); | ||||
| if (object_orig->proxy != nullptr) { | if (object_orig->proxy != nullptr) { | ||||
| ▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | for (deg::IDNode *id_node : graph->id_nodes) { | ||||
| * | * | ||||
| * NOTE: Even if the on_visible_update() is called from the state when | * NOTE: Even if the on_visible_update() is called from the state when | ||||
| * dependency graph is tagged for relations update, it will be fine: | * dependency graph is tagged for relations update, it will be fine: | ||||
| * since dependency graph builder re-schedules entry tags, all the | * since dependency graph builder re-schedules entry tags, all the | ||||
| * tags we request from here will be applied in the updated state of | * tags we request from here will be applied in the updated state of | ||||
| * dependency graph. */ | * dependency graph. */ | ||||
| id_node->previously_visible_components_mask = id_node->visible_components_mask; | id_node->previously_visible_components_mask = id_node->visible_components_mask; | ||||
| } | } | ||||
| } | |||||
| } /* namespace */ | graph->need_visibility_update = false; | ||||
| graph->need_visibility_time_update = false; | |||||
| } | |||||
| NodeType geometry_tag_to_component(const ID *id) | NodeType geometry_tag_to_component(const ID *id) | ||||
| { | { | ||||
| const ID_Type id_type = GS(id->name); | const ID_Type id_type = GS(id->name); | ||||
| switch (id_type) { | switch (id_type) { | ||||
| case ID_OB: { | case ID_OB: { | ||||
| const Object *object = (Object *)id; | const Object *object = (Object *)id; | ||||
| switch (object->type) { | switch (object->type) { | ||||
| ▲ Show 20 Lines • Show All 226 Lines • ▼ Show 20 Lines | |||||
| void DEG_id_type_tag(Main *bmain, short id_type) | void DEG_id_type_tag(Main *bmain, short id_type) | ||||
| { | { | ||||
| for (deg::Depsgraph *depsgraph : deg::get_all_registered_graphs(bmain)) { | for (deg::Depsgraph *depsgraph : deg::get_all_registered_graphs(bmain)) { | ||||
| DEG_graph_id_type_tag(reinterpret_cast<::Depsgraph *>(depsgraph), id_type); | DEG_graph_id_type_tag(reinterpret_cast<::Depsgraph *>(depsgraph), id_type); | ||||
| } | } | ||||
| } | } | ||||
| /* Update dependency graph when visible scenes/layers changes. */ | /* Update dependency graph when visible scenes/layers changes. */ | ||||
| void DEG_graph_on_visible_update(Main *bmain, Depsgraph *depsgraph, const bool do_time) | void DEG_graph_tag_on_visible_update(Depsgraph *depsgraph, const bool do_time) | ||||
| { | { | ||||
| deg::Depsgraph *graph = (deg::Depsgraph *)depsgraph; | deg::Depsgraph *graph = (deg::Depsgraph *)depsgraph; | ||||
| deg::deg_graph_on_visible_update(bmain, graph, do_time); | deg::graph_tag_on_visible_update(graph, do_time); | ||||
| } | } | ||||
| void DEG_on_visible_update(Main *bmain, const bool do_time) | void DEG_tag_on_visible_update(Main *bmain, const bool do_time) | ||||
| { | { | ||||
| for (deg::Depsgraph *depsgraph : deg::get_all_registered_graphs(bmain)) { | for (deg::Depsgraph *depsgraph : deg::get_all_registered_graphs(bmain)) { | ||||
| DEG_graph_on_visible_update(bmain, reinterpret_cast<::Depsgraph *>(depsgraph), do_time); | deg::graph_tag_on_visible_update(depsgraph, do_time); | ||||
| } | } | ||||
| } | } | ||||
| void DEG_enable_editors_update(Depsgraph *depsgraph) | void DEG_enable_editors_update(Depsgraph *depsgraph) | ||||
| { | { | ||||
| deg::Depsgraph *graph = (deg::Depsgraph *)depsgraph; | deg::Depsgraph *graph = (deg::Depsgraph *)depsgraph; | ||||
| graph->use_editors_update = true; | graph->use_editors_update = true; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines | |||||