Apricot Request:

When changing the active action in the NLA editor with NLA-override off, armatures now have their restpose applied before the new action is evaluated. 

I've commented the code here to make it clearer what is going on.
This commit is contained in:
Joshua Leung 2008-07-10 00:15:57 +00:00
parent b915ba5e97
commit 496a9c1a95

@ -501,14 +501,23 @@ static void set_active_strip(Object *ob, bActionStrip *act)
{
bActionStrip *strip;
/* make sure all other strips are not active */
for (strip = ob->nlastrips.first; strip; strip=strip->next)
strip->flag &= ~ACTSTRIP_ACTIVE;
/* act is new active strip */
if (act) {
/* set active flag for this strip */
act->flag |= ACTSTRIP_ACTIVE;
/* check if active action will still be the same one */
if (ob->action != act->act) {
if(ob->action) ob->action->id.us--;
/* clear object's links with its current action (if present) */
if (ob->action) {
ob->action->id.us--;
}
/* only set object's action to active strip's action if possible */
if (act->act->id.lib) {
ob->action= NULL;
}
@ -516,11 +525,23 @@ static void set_active_strip(Object *ob, bActionStrip *act)
ob->action= act->act;
id_us_plus(&ob->action->id);
}
/* request redrawing in relevant spaces */
allqueue(REDRAWIPO, 0);
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
ob->ctime= -1234567.0f; // eveil!
/* when only showing action (i.e. nla-override off),
* reset pose to restpose for armatures
*/
if ((ob->nlaflag & OB_NLA_OVERRIDE)==0) {
if (ob->type == OB_ARMATURE)
rest_pose(ob->pose);
}
/* flush depsgraph */
ob->ctime= -1234567.0f; // evil!
DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA);
}
}