Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/depsgraph_tag.cc
| Show First 20 Lines • Show All 505 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| void deg_graph_on_visible_update(Main *bmain, Depsgraph *graph, const bool do_time) | void deg_graph_on_visible_update(Main *bmain, Depsgraph *graph, const bool do_time) | ||||
| { | { | ||||
| /* 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); | |||||
| if (id_type == ID_OB) { | |||||
| Object *object_orig = reinterpret_cast<Object *>(id_node->id_orig); | |||||
| if (object_orig->proxy != NULL) { | |||||
| object_orig->proxy->proxy_from = object_orig; | |||||
| } | |||||
| } | |||||
| if (!id_node->visible_components_mask) { | if (!id_node->visible_components_mask) { | ||||
| /* ID has no components which affects anything visible. | /* ID has no components which affects anything visible. | ||||
| * No need bother with it to tag or anything. */ | * No need bother with it to tag or anything. */ | ||||
| continue; | continue; | ||||
| } | } | ||||
| int flag = 0; | int flag = 0; | ||||
| if (!DEG::deg_copy_on_write_is_expanded(id_node->id_cow)) { | if (!DEG::deg_copy_on_write_is_expanded(id_node->id_cow)) { | ||||
| flag |= ID_RECALC_COPY_ON_WRITE; | flag |= ID_RECALC_COPY_ON_WRITE; | ||||
| Show All 10 Lines | else { | ||||
| continue; | continue; | ||||
| } | } | ||||
| } | } | ||||
| /* We only tag components which needs an update. Tagging everything is | /* We only tag components which needs an update. Tagging everything is | ||||
| * not a good idea because that might reset particles cache (or any | * not a good idea because that might reset particles cache (or any | ||||
| * other type of cache). | * other type of cache). | ||||
| * | * | ||||
| * TODO(sergey): Need to generalize this somehow. */ | * TODO(sergey): Need to generalize this somehow. */ | ||||
| const ID_Type id_type = GS(id_node->id_orig->name); | |||||
| if (id_type == ID_OB) { | if (id_type == ID_OB) { | ||||
| flag |= ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY; | flag |= ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY; | ||||
| } | } | ||||
| graph_id_tag_update(bmain, graph, id_node->id_orig, flag, DEG_UPDATE_SOURCE_VISIBILITY); | graph_id_tag_update(bmain, graph, id_node->id_orig, flag, DEG_UPDATE_SOURCE_VISIBILITY); | ||||
| if (id_type == ID_SCE) { | if (id_type == ID_SCE) { | ||||
| /* Make sure collection properties are up to date. */ | /* Make sure collection properties are up to date. */ | ||||
| id_node->tag_update(graph, DEG_UPDATE_SOURCE_VISIBILITY); | id_node->tag_update(graph, DEG_UPDATE_SOURCE_VISIBILITY); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 284 Lines • Show Last 20 Lines | |||||