forked from bartvdbraak/blender
Depsgraph: Free user code from worry about updates flush
This commit is contained in:
parent
ac060232aa
commit
31c2929496
@ -1566,8 +1566,6 @@ static void scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain, bool on
|
|||||||
// DEG_debug_graph_relations_validate(depsgraph, bmain, scene);
|
// DEG_debug_graph_relations_validate(depsgraph, bmain, scene);
|
||||||
/* Flush editing data if needed. */
|
/* Flush editing data if needed. */
|
||||||
prepare_mesh_for_viewport_render(bmain, view_layer);
|
prepare_mesh_for_viewport_render(bmain, view_layer);
|
||||||
/* Flush recalc flags to dependencies. */
|
|
||||||
DEG_graph_flush_update(bmain, depsgraph);
|
|
||||||
/* Update all objects: drivers, matrices, displists, etc. flags set
|
/* Update all objects: drivers, matrices, displists, etc. flags set
|
||||||
* by depgraph or manual, no layer check here, gets correct flushed.
|
* by depgraph or manual, no layer check here, gets correct flushed.
|
||||||
*/
|
*/
|
||||||
|
@ -128,11 +128,6 @@ void DEG_id_type_tag(struct Main *bmain, short id_type);
|
|||||||
|
|
||||||
void DEG_ids_clear_recalc(struct Main *bmain, Depsgraph *depsgraph);
|
void DEG_ids_clear_recalc(struct Main *bmain, Depsgraph *depsgraph);
|
||||||
|
|
||||||
/* Update Flushing ------------------------------- */
|
|
||||||
|
|
||||||
/* Flush updates for IDs in a single scene. */
|
|
||||||
void DEG_graph_flush_update(struct Main *bmain, Depsgraph *depsgraph);
|
|
||||||
|
|
||||||
/* Check if something was changed in the database and inform
|
/* Check if something was changed in the database and inform
|
||||||
* editors about this.
|
* editors about this.
|
||||||
*/
|
*/
|
||||||
|
@ -49,7 +49,7 @@ extern "C" {
|
|||||||
#include "intern/depsgraph.h"
|
#include "intern/depsgraph.h"
|
||||||
|
|
||||||
/* Evaluate all nodes tagged for updating. */
|
/* Evaluate all nodes tagged for updating. */
|
||||||
void DEG_evaluate_on_refresh(Main * /*bmain*/, Depsgraph *graph)
|
void DEG_evaluate_on_refresh(Main *bmain, Depsgraph *graph)
|
||||||
{
|
{
|
||||||
DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(graph);
|
DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(graph);
|
||||||
deg_graph->ctime = BKE_scene_frame_get(deg_graph->scene);
|
deg_graph->ctime = BKE_scene_frame_get(deg_graph->scene);
|
||||||
@ -60,6 +60,7 @@ void DEG_evaluate_on_refresh(Main * /*bmain*/, Depsgraph *graph)
|
|||||||
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_graph_flush_updates(bmain, deg_graph);
|
||||||
DEG::deg_evaluate_on_refresh(deg_graph);
|
DEG::deg_evaluate_on_refresh(deg_graph);
|
||||||
deg_graph->need_update_time = false;
|
deg_graph->need_update_time = false;
|
||||||
}
|
}
|
||||||
|
@ -779,14 +779,6 @@ void DEG_id_type_tag(Main *bmain, short id_type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DEG_graph_flush_update(Main *bmain, Depsgraph *depsgraph)
|
|
||||||
{
|
|
||||||
if (depsgraph == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
DEG::deg_graph_flush_updates(bmain, (DEG::Depsgraph *)depsgraph);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 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_on_visible_update(Main *bmain, Depsgraph *depsgraph, const bool do_time)
|
||||||
{
|
{
|
||||||
|
@ -210,7 +210,6 @@ static void compo_initjob(void *cjv)
|
|||||||
|
|
||||||
/* NOTE: Don't update animation to preserve unkeyed changes, this means can not use
|
/* NOTE: Don't update animation to preserve unkeyed changes, this means can not use
|
||||||
* evaluate_on_framechange. */
|
* evaluate_on_framechange. */
|
||||||
DEG_graph_flush_update(bmain, cj->compositor_depsgraph);
|
|
||||||
DEG_evaluate_on_refresh(bmain, cj->compositor_depsgraph);
|
DEG_evaluate_on_refresh(bmain, cj->compositor_depsgraph);
|
||||||
|
|
||||||
bNodeTree *ntree_eval = (bNodeTree *)DEG_get_evaluated_id(cj->compositor_depsgraph,
|
bNodeTree *ntree_eval = (bNodeTree *)DEG_get_evaluated_id(cj->compositor_depsgraph,
|
||||||
|
Loading…
Reference in New Issue
Block a user