[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27022] trunk/blender/source/blender: scene_update_for_newframe was calling DAG_scene_update_flags() and BKE_animsys_evaluate_all_animation() for each set.

Campbell Barton ideasman42 at gmail.com
Fri Feb 19 14:13:23 CET 2010


Revision: 27022
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27022
Author:   campbellbarton
Date:     2010-02-19 14:13:21 +0100 (Fri, 19 Feb 2010)

Log Message:
-----------
scene_update_for_newframe was calling DAG_scene_update_flags() and BKE_animsys_evaluate_all_animation() for each set.
gain some speedup by only calling once.

minor printf changes to readfile.c, no functional change.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/scene.c
    trunk/blender/source/blender/blenloader/intern/readfile.c

Modified: trunk/blender/source/blender/blenkernel/intern/scene.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/scene.c	2010-02-19 12:20:29 UTC (rev 27021)
+++ trunk/blender/source/blender/blenkernel/intern/scene.c	2010-02-19 13:13:21 UTC (rev 27022)
@@ -862,21 +862,7 @@
 {
 	Base *base;
 	Object *ob;
-	float ctime = frame_to_float(sce, sce->r.cfra); 
 	
-	if(sce->theDag==NULL)
-		DAG_scene_sort(sce);
-	
-	DAG_scene_update_flags(sce, lay);   // only stuff that moves or needs display still
-	
-	/* All 'standard' (i.e. without any dependencies) animation is handled here,
-	 * with an 'local' to 'macro' order of evaluation. This should ensure that
-	 * settings stored nestled within a hierarchy (i.e. settings in a Texture block
-	 * can be overridden by settings from Scene, which owns the Texture through a hierarchy 
-	 * such as Scene->World->MTex/Texture) can still get correctly overridden.
-	 */
-	BKE_animsys_evaluate_all_animation(G.main, ctime);
-	
 	for(base= sce->base.first; base; base= base->next) {
 		ob= base->object;
 		
@@ -928,16 +914,37 @@
 /* applies changes right away, does all sets too */
 void scene_update_for_newframe(Scene *sce, unsigned int lay)
 {
-	Scene *scene= sce;
+	float ctime = frame_to_float(sce, sce->r.cfra);
+	Scene *sce_iter;
 	
 	/* clear animation overrides */
 	// XXX TODO...
-	
+
+	for(sce_iter= sce; sce_iter; sce_iter= sce_iter->set) {
+		if(sce_iter->theDag==NULL)
+			DAG_scene_sort(sce_iter);
+	}
+
+
+	/* Following 2 functions are recursive
+	 * so dont call within 'scene_update_newframe' */
+	DAG_scene_update_flags(sce, lay);   // only stuff that moves or needs display still
+
+	/* All 'standard' (i.e. without any dependencies) animation is handled here,
+	 * with an 'local' to 'macro' order of evaluation. This should ensure that
+	 * settings stored nestled within a hierarchy (i.e. settings in a Texture block
+	 * can be overridden by settings from Scene, which owns the Texture through a hierarchy
+	 * such as Scene->World->MTex/Texture) can still get correctly overridden.
+	 */
+	BKE_animsys_evaluate_all_animation(G.main, ctime);
+	/*...done with recusrive funcs */
+
+
 	/* sets first, we allow per definition current scene to have dependencies on sets */
-	for(sce= sce->set; sce; sce= sce->set)
-		scene_update_newframe(sce, lay);
+	for(sce_iter= sce->set; sce_iter; sce_iter= sce_iter->set)
+		scene_update_newframe(sce_iter, lay);
 
-	scene_update_newframe(scene, lay);
+	scene_update_newframe(sce, lay);
 }
 
 /* return default layer, also used to patch old files */

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2010-02-19 12:20:29 UTC (rev 27021)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2010-02-19 13:13:21 UTC (rev 27022)
@@ -3436,6 +3436,7 @@
 				if(ob->proxy->id.lib==NULL) {
 					ob->proxy->proxy_from= NULL;
 					ob->proxy= NULL;
+					printf("Proxy lost from  object %s lib %s\n", ob->id.name+2, ob->id.lib->name);
 				}
 				else {
 					/* this triggers object_update to always use a copy */
@@ -3450,11 +3451,14 @@
 			ob->data= newlibadr_us(fd, ob->id.lib, ob->data);
 			   
 			if(ob->data==NULL && poin!=NULL) {
+				if(ob->id.lib)
+					printf("Can't find obdata of %s lib %s\n", ob->id.name+2, ob->id.lib->name);
+				else
+					printf("Object %s lost data.\n", ob->id.name+2);
+
 				ob->type= OB_EMPTY;
 				warn= 1;
-				if(ob->id.lib) printf("Can't find obdata of %s lib %s\n", ob->id.name+2, ob->id.lib->name);
-				else printf("Object %s lost data.\n", ob->id.name+2);
-				
+
 				if(ob->pose) {
 					free_pose(ob->pose);
 					ob->pose= NULL;





More information about the Bf-blender-cvs mailing list