[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16546] branches/harmonic-skeleton/source/ blender: Benchmarkings timer cleanup

Martin Poirier theeth at yahoo.com
Mon Sep 15 23:48:05 CEST 2008


Revision: 16546
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16546
Author:   theeth
Date:     2008-09-15 23:48:05 +0200 (Mon, 15 Sep 2008)

Log Message:
-----------
Benchmarkings timer cleanup
Don't number groups with only one arc (easy fix for fly model, need a two pass arc match for real fix)

Modified Paths:
--------------
    branches/harmonic-skeleton/source/blender/blenlib/intern/graph.c
    branches/harmonic-skeleton/source/blender/src/autoarmature.c
    branches/harmonic-skeleton/source/blender/src/reeb.c

Modified: branches/harmonic-skeleton/source/blender/blenlib/intern/graph.c
===================================================================
--- branches/harmonic-skeleton/source/blender/blenlib/intern/graph.c	2008-09-15 21:37:27 UTC (rev 16545)
+++ branches/harmonic-skeleton/source/blender/blenlib/intern/graph.c	2008-09-15 21:48:05 UTC (rev 16546)
@@ -732,6 +732,7 @@
 
 			if (sub_total == 1)
 			{
+				group -= 1; /* not really a group so decrement */
 				/* NOTHING TO DO */
 			}
 			else if (sub_total == 2)

Modified: branches/harmonic-skeleton/source/blender/src/autoarmature.c
===================================================================
--- branches/harmonic-skeleton/source/blender/src/autoarmature.c	2008-09-15 21:37:27 UTC (rev 16545)
+++ branches/harmonic-skeleton/source/blender/src/autoarmature.c	2008-09-15 21:48:05 UTC (rev 16546)
@@ -2827,11 +2827,15 @@
 	Base *base;
 	ReebGraph *reebg;
 	double start_time, end_time;
+	double gstart_time, gend_time;
+	double reeb_time, rig_time, retarget_time;
 	
-	start_time = PIL_check_seconds_timer();
+	gstart_time = start_time = PIL_check_seconds_timer();
 	
 	reebg = BIF_ReebGraphMultiFromEditMesh();
 	
+	end_time = PIL_check_seconds_timer();
+	reeb_time = end_time - start_time;
 	
 	printf("Reeb Graph created\n");
 
@@ -2853,8 +2857,13 @@
 				list.first= list.last = NULL;
 				make_boneList(&list, &arm->bonebase, NULL);
 			
+				start_time = PIL_check_seconds_timer();
+	
 				rigg = armatureToGraph(ob, &list);
 				
+				end_time = PIL_check_seconds_timer();
+				rig_time = end_time - start_time;
+
 				printf("Armature graph created\n");
 		
 				//RIG_printGraph(rigg);
@@ -2863,8 +2872,13 @@
 				
 				printf("retargetting %s\n", ob->id.name);
 				
+				start_time = PIL_check_seconds_timer();
+
 				retargetGraphs(rigg);
 				
+				end_time = PIL_check_seconds_timer();
+				retarget_time = end_time - start_time;
+
 				/* Turn the list into an armature */
 				editbones_to_armature(&list, ob);
 				
@@ -2877,10 +2891,13 @@
 
 	REEB_freeGraph(reebg);
 	
-	end_time = PIL_check_seconds_timer();
+	gend_time = PIL_check_seconds_timer();
 
 	printf("-----------\n");
-	printf("runtime: %.3f\n", end_time - start_time);
+	printf("runtime: \t%.3f\n", gend_time - gstart_time);
+	printf("reeb: \t%.3f\n", reeb_time);
+	printf("rig: \t%.3f\n", rig_time);
+	printf("retarget: \t%.3f\n", retarget_time);
 	printf("-----------\n");
 	
 	BIF_undo_push("Retarget Skeleton");

Modified: branches/harmonic-skeleton/source/blender/src/reeb.c
===================================================================
--- branches/harmonic-skeleton/source/blender/src/reeb.c	2008-09-15 21:37:27 UTC (rev 16545)
+++ branches/harmonic-skeleton/source/blender/src/reeb.c	2008-09-15 21:48:05 UTC (rev 16546)
@@ -3413,9 +3413,6 @@
 	ReebGraph *rg = NULL;
 	ReebGraph *rgi, *previous;
 	int i, nb_levels = REEB_MAX_MULTI_LEVEL;
-	double start_time, end_time;
-	
-	start_time = PIL_check_seconds_timer();
 
 	if (em == NULL)
 		return NULL;
@@ -3438,12 +3435,6 @@
 	
 	freeEdgeIndex(&indexed_edges);
 
-	end_time = PIL_check_seconds_timer();
-
-	printf("-----------\n");
-	printf("runtime: %.3f\n", end_time - start_time);
-	printf("-----------\n");
-
 #ifdef DEBUG_REEB
 	weightToVCol(em, 0);
 #endif





More information about the Bf-blender-cvs mailing list