diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-02-21 23:33:04 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-02-21 23:33:04 +0400 |
commit | 20220d47e38c4ad22ad89481fd40b804cc2fd1ef (patch) | |
tree | 5e01f917fa80465bb6401d63f8057641813983d9 /source/blender/blenkernel/BKE_depsgraph.h | |
parent | 074565330db93ceb2304247f9bf6499b05cb3b80 (diff) |
Dependency Graph: some refactoring which should have no user visible impact
besides performance in some cases.
* DAG_scene_sort is now removed and replaced by DAG_relations_tag_update in
most cases. This will clear the dependency graph, and only rebuild it right
before it's needed again when the scene is re-evaluated.
This is done because DAG_scene_sort is slow when called many times from
python operators. Further the scene argument is not needed because most
operations can potentially affect more than the current scene.
* DAG_scene_relations_update will now rebuild the dependency graph if it's not
there yet, and DAG_scene_relations_rebuild will force a rebuild for the rare
cases that need it.
* Remove various places where ob->recalc was set manually. This should go
through DAG_id_tag_update() in nearly all cases instead since this is now
a fast operation. Also removed DAG_ids_flush_update that goes along with
such manual tagging of ob->recalc.
Diffstat (limited to 'source/blender/blenkernel/BKE_depsgraph.h')
-rw-r--r-- | source/blender/blenkernel/BKE_depsgraph.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/blenkernel/BKE_depsgraph.h b/source/blender/blenkernel/BKE_depsgraph.h index 49dc1bfd732..eaf19f8dd08 100644 --- a/source/blender/blenkernel/BKE_depsgraph.h +++ b/source/blender/blenkernel/BKE_depsgraph.h @@ -99,8 +99,16 @@ int is_acyclic(struct DagForest *dag); /* ********** API *************** */ /* Note that the DAG never executes changes in Objects, only sets flags in Objects */ -/* (re)-create dependency graph for scene */ -void DAG_scene_sort(struct Main *bmain, struct Scene *sce); +/* clear all dependency graphs, call this when changing relations between objects. + * the dependency graphs will be rebuilt just before they are used to avoid them + * getting rebuild many times during operators */ +void DAG_relations_tag_update(struct Main *bmain); + +/* (re)-create the dependency graph before using it */ +void DAG_scene_relations_update(struct Main *bmain, struct Scene *sce); + +/* force an immediate rebuild of the dependency graph, only needed in rare cases */ +void DAG_scene_relations_rebuild(struct Main *bmain, struct Scene *scene); /* flag all objects that need recalc because they're animated */ void DAG_scene_update_flags(struct Main *bmain, struct Scene *sce, unsigned int lay, const short do_time); @@ -109,9 +117,6 @@ void DAG_scene_flush_update(struct Main *bmain, struct Scene *sce, unsigned i /* tag objects for update on file load */ void DAG_on_visible_update(struct Main *bmain, const short do_time); -/* when setting manual RECALC flags, call this afterwards */ -void DAG_ids_flush_update(struct Main *bmain, int time); - /* tag datablock to get updated for the next redraw */ void DAG_id_tag_update(struct ID *id, short flag); /* flush all tagged updates */ |