* 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.
This commit is contained in:
Joshua Leung
2007-12-04 08:53:41 +00:00
parent 3e544d04b5
commit 6d3a5625fd

View File

@@ -248,9 +248,21 @@ void pose_calculate_path(Object *ob)
cfra= CFRA;
sfra = arm->pathsf;
efra = arm->pathef;
if (efra<=sfra) return;
if (efra <= sfra) {
error("Can't calculate paths when pathlen <= 0");
return;
}
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());
DAG_object_update_flags(G.scene, ob, screen_view3d_layers());
/* malloc the path blocks */
for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
@@ -296,6 +308,8 @@ void pose_calculate_path(Object *ob)
}
}
waitcursor(0);
CFRA= cfra;
allqueue(REDRAWVIEW3D, 0); /* recalc tags are still there */
allqueue(REDRAWBUTSEDIT, 0);