Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/depsgraph_eval.cc
| Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | void DEG_evaluate_on_refresh(Depsgraph *graph) | ||||
| /* Update time on primary timesource. */ | /* Update time on primary timesource. */ | ||||
| DEG::TimeSourceNode *tsrc = deg_graph->find_time_source(); | DEG::TimeSourceNode *tsrc = deg_graph->find_time_source(); | ||||
| tsrc->cfra = deg_graph->ctime; | tsrc->cfra = deg_graph->ctime; | ||||
| /* Update time in scene. */ | /* Update time in scene. */ | ||||
| if (deg_graph->scene_cow) { | if (deg_graph->scene_cow) { | ||||
| BKE_scene_frame_set(deg_graph->scene_cow, deg_graph->ctime); | BKE_scene_frame_set(deg_graph->scene_cow, deg_graph->ctime); | ||||
| } | } | ||||
| DEG::deg_evaluate_on_refresh(deg_graph); | DEG::deg_evaluate_on_refresh(deg_graph); | ||||
| deg_graph->need_update_time = false; | |||||
| } | } | ||||
| /* Frame-change happened for root scene that graph belongs to. */ | /* Frame-change happened for root scene that graph belongs to. */ | ||||
| void DEG_evaluate_on_framechange(Main *bmain, Depsgraph *graph, float ctime) | void DEG_evaluate_on_framechange(Main *bmain, Depsgraph *graph, float ctime) | ||||
| { | { | ||||
| DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(graph); | DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(graph); | ||||
| deg_graph->ctime = ctime; | deg_graph->ctime = ctime; | ||||
| /* Update time on primary timesource. */ | /* Update time on primary timesource. */ | ||||
| DEG::TimeSourceNode *tsrc = deg_graph->find_time_source(); | DEG::TimeSourceNode *tsrc = deg_graph->find_time_source(); | ||||
| tsrc->cfra = ctime; | tsrc->cfra = ctime; | ||||
| tsrc->tag_update(deg_graph, DEG::DEG_UPDATE_SOURCE_TIME); | tsrc->tag_update(deg_graph, DEG::DEG_UPDATE_SOURCE_TIME); | ||||
| DEG::deg_graph_flush_updates(bmain, deg_graph); | DEG::deg_graph_flush_updates(bmain, deg_graph); | ||||
| /* Update time in scene. */ | /* Update time in scene. */ | ||||
| if (deg_graph->scene_cow) { | if (deg_graph->scene_cow) { | ||||
| BKE_scene_frame_set(deg_graph->scene_cow, deg_graph->ctime); | BKE_scene_frame_set(deg_graph->scene_cow, deg_graph->ctime); | ||||
| } | } | ||||
| /* Perform recalculation updates. */ | /* Perform recalculation updates. */ | ||||
| DEG::deg_evaluate_on_refresh(deg_graph); | DEG::deg_evaluate_on_refresh(deg_graph); | ||||
| deg_graph->need_update_time = false; | |||||
| } | } | ||||
| bool DEG_needs_eval(Depsgraph *graph) | bool DEG_needs_eval(Depsgraph *graph) | ||||
| { | { | ||||
| DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(graph); | DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(graph); | ||||
| return BLI_gset_len(deg_graph->entry_tags) != 0; | return BLI_gset_len(deg_graph->entry_tags) != 0; | ||||
| } | } | ||||