[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12775] trunk/blender/source/blender/src/ poseobject.c: Bugfix:

Joshua Leung aligorith at gmail.com
Tue Dec 4 09:53:41 CET 2007


Revision: 12775
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12775
Author:   aligorith
Date:     2007-12-04 09:53:41 +0100 (Tue, 04 Dec 2007)

Log Message:
-----------
Bugfix:

* Bone Paths calculation should now work on unsaved files. This long standing bug has been hacked around by manually forcing OB_RECALC to be set for the active object (depsgraph should really do this, but it doesn't!)

* Added waitcursor for calculating paths (useful on longer paths). I was going to add a progressbar as well, but that decreased performance overall.

Modified Paths:
--------------
    trunk/blender/source/blender/src/poseobject.c

Modified: trunk/blender/source/blender/src/poseobject.c
===================================================================
--- trunk/blender/source/blender/src/poseobject.c	2007-12-04 05:53:32 UTC (rev 12774)
+++ trunk/blender/source/blender/src/poseobject.c	2007-12-04 08:53:41 UTC (rev 12775)
@@ -248,10 +248,22 @@
 	cfra= CFRA;
 	sfra = arm->pathsf;
 	efra = arm->pathef;
-	if (efra<=sfra) return;
+	if (efra <= sfra) {
+		error("Can't calculate paths when pathlen <= 0");
+		return;
+	}
 	
-	DAG_object_update_flags(G.scene, ob, screen_view3d_layers());
+	waitcursor(1);
 	
+	/* hack: for unsaved files, set OB_RECALC so that paths can get calculated */
+	if ((ob->recalc & OB_RECALC)==0) {
+		ob->recalc |= OB_RECALC;
+		DAG_object_update_flags(G.scene, ob, screen_view3d_layers());
+	}
+	else
+		DAG_object_update_flags(G.scene, ob, screen_view3d_layers());
+	
+	
 	/* malloc the path blocks */
 	for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
 		if ((pchan->bone) && (pchan->bone->flag & BONE_SELECTED)) {
@@ -273,6 +285,7 @@
 				int temp= base->object->recalc;
 				object_handle_update(base->object);
 				base->object->recalc= temp;
+				printf("base->object->recalc = %d \n", base->object->recalc);
 			}
 		}
 		
@@ -296,6 +309,8 @@
 		}
 	}
 	
+	waitcursor(0);
+	
 	CFRA= cfra;
 	allqueue(REDRAWVIEW3D, 0);	/* recalc tags are still there */
 	allqueue(REDRAWBUTSEDIT, 0);





More information about the Bf-blender-cvs mailing list