diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-06-06 09:06:46 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-06-06 09:06:46 +0400 |
commit | 9621d626a0484d19e2c18e57cbdd5f9c24c827f4 (patch) | |
tree | a248a862adbfc095c25bf94d407631ea1afb1244 /source/blender/blenkernel/intern | |
parent | 964d44e6bcbc4f01e12de0ba097654564df252ab (diff) |
NLA SoC: Various user-counts and file IO bugfixes for tweaking actions...
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/nla.c | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index fb4c2663c3c..390efc5ced4 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -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); diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index d3a01b6d610..9acbad32a42 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -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; |