diff options
author | Joshua Leung <aligorith@gmail.com> | 2007-12-04 11:53:41 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2007-12-04 11:53:41 +0300 |
commit | 6d3a5625fd3b505a59a9952a64d080e6c8d8bd0a (patch) | |
tree | 5e761ef00de8e149c790315674d1881637e03b7c /source/blender/src/poseobject.c | |
parent | 3e544d04b560e93a6e6ccae36084f17fd9faa674 (diff) |
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.
Diffstat (limited to 'source/blender/src/poseobject.c')
-rw-r--r-- | source/blender/src/poseobject.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c index 7bcacfe3380..c22dcb69119 100644 --- a/source/blender/src/poseobject.c +++ b/source/blender/src/poseobject.c @@ -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); |