[Bf-blender-cvs] [d012c9d0f46] blender2.8: Depsgraph: Remove residue of motion path optimization

Sergey Sharybin noreply at git.blender.org
Tue Oct 24 16:42:10 CEST 2017


Commit: d012c9d0f46f931bc308da3fd70d9d7d5b298bb3
Author: Sergey Sharybin
Date:   Tue Oct 24 16:39:26 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBd012c9d0f46f931bc308da3fd70d9d7d5b298bb3

Depsgraph: Remove residue of motion path optimization

This needs to be re-implemented in a new fashion, without touching global list
of bases and become compatible with the new dependency graph.

The idea to go here would be to create new dependency graph for motion path
evaluation, bring a single object in there (which will pull all dependencies
at a construction) and use that.

Needs working copy-on-write first tho.

===================================================================

M	source/blender/blenkernel/intern/anim.c
M	source/blender/depsgraph/DEG_depsgraph_build.h

===================================================================

diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 34ab8a064d4..758bf588a9c 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -275,45 +275,6 @@ void animviz_get_object_motionpaths(Object *ob, ListBase *targets)
 
 /* ........ */
 
-/* Note on evaluation optimizations:
- * Optimization's currently used here play tricks with the depsgraph in order to try and
- * evaluate as few objects as strictly necessary to get nicer performance under standard
- * production conditions. For those people who really need the accurate version, 
- * disable the ifdef (i.e. 1 -> 0) and comment out the call to motionpaths_calc_optimise_depsgraph()
- */
-
-/* tweak the object ordering to trick depsgraph into making MotionPath calculations run faster */
-static void motionpaths_calc_optimise_depsgraph(bContext *C, Scene *scene, ListBase *targets)
-{
-	BaseLegacy *base, *baseNext;
-	MPathTarget *mpt;
-	Main *bmain = CTX_data_main(C);
-	
-	/* make sure our temp-tag isn't already in use */
-	for (base = scene->base.first; base; base = base->next)
-		base->object->flag &= ~BA_TEMP_TAG;
-	
-	/* for each target, dump its object to the start of the list if it wasn't moved already */
-	for (mpt = targets->first; mpt; mpt = mpt->next) {
-		for (base = scene->base.first; base; base = baseNext) {
-			baseNext = base->next;
-			
-			if ((base->object == mpt->ob) && !(mpt->ob->flag & BA_TEMP_TAG)) {
-				BLI_remlink(&scene->base, base);
-				BLI_addhead(&scene->base, base);
-				
-				mpt->ob->flag |= BA_TEMP_TAG;
-				
-				/* we really don't need to continue anymore once this happens, but this line might really 'break' */
-				break;
-			}
-		}
-	}
-	
-	/* "brew me a list that's sorted a bit faster now depsy" */
-	DEG_scene_relations_rebuild(bmain, scene);
-}
-
 /* update scene for current frame */
 static void motionpaths_calc_update_scene(Scene *scene)
 {
@@ -375,7 +336,7 @@ static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets)
  *	- recalc: whether we need to
  */
 /* TODO: include reports pointer? */
-void animviz_calc_motionpaths(bContext *C, Scene *scene, ListBase *targets)
+void animviz_calc_motionpaths(bContext *UNUSED(C), Scene *scene, ListBase *targets)
 {
 	MPathTarget *mpt;
 	int sfra, efra;
@@ -399,10 +360,6 @@ void animviz_calc_motionpaths(bContext *C, Scene *scene, ListBase *targets)
 	}
 	if (efra <= sfra) return;
 	
-	/* optimize the depsgraph for faster updates */
-	/* TODO: whether this is used should depend on some setting for the level of optimizations used */
-	motionpaths_calc_optimise_depsgraph(C, scene, targets);
-	
 	/* calculate path over requested range */
 	for (CFRA = sfra; CFRA <= efra; CFRA++) {
 		/* update relevant data for new frame */
diff --git a/source/blender/depsgraph/DEG_depsgraph_build.h b/source/blender/depsgraph/DEG_depsgraph_build.h
index 067bd5ba8e9..84cf12ba675 100644
--- a/source/blender/depsgraph/DEG_depsgraph_build.h
+++ b/source/blender/depsgraph/DEG_depsgraph_build.h
@@ -74,8 +74,7 @@ void DEG_relations_tag_update(struct Main *bmain);
 void DEG_scene_relations_update(struct Main *bmain, struct Scene *scene);
 
 /* Rebuild dependency graph only for a given scene. */
-void DEG_scene_relations_rebuild(struct Main *bmain,
-                                 struct Scene *scene);
+void DEG_scene_relations_rebuild(struct Main *bmain, struct Scene *scene);
 
 /* Add Dependencies  ----------------------------- */



More information about the Bf-blender-cvs mailing list