Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/eval/deg_eval_flush.cc
| Show All 33 Lines | |||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_math_vector.h" | #include "BLI_math_vector.h" | ||||
| #include "BLI_task.h" | #include "BLI_task.h" | ||||
| #include "BLI_ghash.h" | #include "BLI_ghash.h" | ||||
| extern "C" { | extern "C" { | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_scene_types.h" | |||||
| #include "DRW_engine.h" | #include "DRW_engine.h" | ||||
| } /* extern "C" */ | } /* extern "C" */ | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "intern/debug/deg_debug.h" | #include "intern/debug/deg_debug.h" | ||||
| #include "intern/depsgraph.h" | #include "intern/depsgraph.h" | ||||
| #include "intern/depsgraph_update.h" | #include "intern/depsgraph_update.h" | ||||
| #include "intern/node/deg_node.h" | #include "intern/node/deg_node.h" | ||||
| #include "intern/node/deg_node_component.h" | #include "intern/node/deg_node_component.h" | ||||
| #include "intern/node/deg_node_factory.h" | #include "intern/node/deg_node_factory.h" | ||||
| #include "intern/node/deg_node_id.h" | #include "intern/node/deg_node_id.h" | ||||
| #include "intern/node/deg_node_operation.h" | #include "intern/node/deg_node_operation.h" | ||||
| #include "intern/node/deg_node_time.h" | |||||
| #include "intern/eval/deg_eval_copy_on_write.h" | #include "intern/eval/deg_eval_copy_on_write.h" | ||||
| // Invalidate data-block data when update is flushed on it. | // Invalidate data-block data when update is flushed on it. | ||||
| // | // | ||||
| // The idea of this is to help catching cases when area is accessing data which | // The idea of this is to help catching cases when area is accessing data which | ||||
| // is not yet evaluated, which could happen due to missing relations. The issue | // is not yet evaluated, which could happen due to missing relations. The issue | ||||
| // is that usually that data will be kept from previous frame, and it looks to | // is that usually that data will be kept from previous frame, and it looks to | ||||
| ▲ Show 20 Lines • Show All 279 Lines • ▼ Show 20 Lines | |||||
| * are tagged. | * are tagged. | ||||
| */ | */ | ||||
| void deg_graph_flush_updates(Main *bmain, Depsgraph *graph) | void deg_graph_flush_updates(Main *bmain, Depsgraph *graph) | ||||
| { | { | ||||
| /* Sanity checks. */ | /* Sanity checks. */ | ||||
| BLI_assert(bmain != NULL); | BLI_assert(bmain != NULL); | ||||
| BLI_assert(graph != NULL); | BLI_assert(graph != NULL); | ||||
| /* Nothing to update, early out. */ | /* Nothing to update, early out. */ | ||||
| if (BLI_gset_len(graph->entry_tags) == 0) { | if (BLI_gset_len(graph->entry_tags) == 0 && !graph->need_update_time) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (graph->need_update_time) { | |||||
| const Scene *scene_orig = graph->scene; | |||||
| const float ctime = scene_orig->r.cfra + scene_orig->r.subframe; | |||||
| DEG::TimeSourceNode *time_source = graph->find_time_source(); | |||||
| graph->ctime = ctime; | |||||
| time_source->tag_update(graph, DEG::DEG_UPDATE_SOURCE_TIME); | |||||
| } | |||||
| /* Reset all flags, get ready for the flush. */ | /* Reset all flags, get ready for the flush. */ | ||||
| flush_prepare(graph); | flush_prepare(graph); | ||||
| /* Starting from the tagged "entry" nodes, flush outwards. */ | /* Starting from the tagged "entry" nodes, flush outwards. */ | ||||
| FlushQueue queue; | FlushQueue queue; | ||||
| flush_schedule_entrypoints(graph, &queue); | flush_schedule_entrypoints(graph, &queue); | ||||
| /* Prepare update context for editors. */ | /* Prepare update context for editors. */ | ||||
| DEGEditorUpdateContext update_ctx; | DEGEditorUpdateContext update_ctx; | ||||
| update_ctx.bmain = bmain; | update_ctx.bmain = bmain; | ||||
| ▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines | |||||