NLA SoC: Various user-counts and file IO bugfixes for tweaking actions...

This commit is contained in:
2009-06-06 05:06:46 +00:00
parent 964d44e6bc
commit 9621d626a0
3 changed files with 7 additions and 2 deletions

View File

@@ -154,7 +154,7 @@ AnimData *BKE_copy_animdata (AnimData *adt)
// XXX review this... it might not be optimal behaviour yet...
//id_us_plus((ID *)dadt->action);
dadt->action= copy_action(adt->action);
dadt->tmpact= copy_action(adt->action);
dadt->tmpact= copy_action(adt->tmpact);
/* duplicate NLA data */
copy_nladata(&dadt->nla_tracks, &adt->nla_tracks);

View File

@@ -675,11 +675,12 @@ short BKE_nla_tweakmode_enter (AnimData *adt)
/* handle AnimData level changes:
* - 'real' active action to temp storage (no need to change user-counts)
* - action of active strip set to be the 'active action'
* - action of active strip set to be the 'active action', and have its usercount incremented
* - editing-flag for this AnimData block should also get turned on (for more efficient restoring)
*/
adt->tmpact= adt->action;
adt->action= activeStrip->act;
id_us_plus(&activeStrip->act->id);
adt->flag |= ADT_NLA_EDIT_ON;
/* done! */
@@ -706,10 +707,12 @@ void BKE_nla_tweakmode_exit (AnimData *adt)
nlt->flag &= ~NLATRACK_DISABLED;
/* handle AnimData level changes:
* - 'temporary' active action needs its usercount decreased, since we're removing this reference
* - 'real' active action is restored from storage
* - storage pointer gets cleared (to avoid having bad notes hanging around)
* - editing-flag for this AnimData block should also get turned off
*/
if (adt->action) adt->action->id.us--;
adt->action= adt->tmpact;
adt->tmpact= NULL;
adt->flag &= ~ADT_NLA_EDIT_ON;

View File

@@ -1896,6 +1896,7 @@ static void lib_link_animdata(FileData *fd, ID *id, AnimData *adt)
/* link action data */
adt->action= newlibadr_us(fd, id->lib, adt->action);
adt->tmpact= newlibadr_us(fd, id->lib, adt->tmpact);
/* link drivers */
lib_link_fcurves(fd, id, &adt->drivers);
@@ -9406,6 +9407,7 @@ static void expand_animdata(FileData *fd, Main *mainvar, AnimData *adt)
/* own action */
expand_doit(fd, mainvar, adt->action);
expand_doit(fd, mainvar, adt->tmpact);
/* drivers - assume that these F-Curves have driver data to be in this list... */
for (fcd= adt->drivers.first; fcd; fcd= fcd->next) {