diff options
author | Ton Roosendaal <ton@blender.org> | 2006-01-05 19:12:02 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-01-05 19:12:02 +0300 |
commit | febd2a8f2821bff69da95e13bfc40051aa708d0d (patch) | |
tree | ce5f6e3363738c1ba9d1347b2d821e7ca8232317 /source/blender/blenkernel | |
parent | fbe9a17138b05a0602defdb97146e8e95ca7d9d1 (diff) |
orange bugfix: "Make local Action" did not set the Ipos in channels to
local (or make copy if used by other actions), causing in loss of ipo's.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/action.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 50ce4495f9c..b160dd41522 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -83,6 +83,38 @@ /* ***************** Library data level operations on action ************** */ +static void make_local_action_channels(bAction *act) +{ + bActionChannel *chan; + bConstraintChannel *conchan; + + for (chan=act->chanbase.first; chan; chan=chan->next) { + if(chan->ipo) { + if(chan->ipo->id.us==1) { + chan->ipo->id.lib= NULL; + chan->ipo->id.flag= LIB_LOCAL; + new_id(0, (ID *)chan->ipo, 0); + } + else { + chan->ipo= copy_ipo(chan->ipo); + } + } + for (conchan=chan->constraintChannels.first; conchan; conchan=conchan->next) { + if(conchan->ipo) { + if(conchan->ipo->id.us==1) { + conchan->ipo->id.lib= NULL; + conchan->ipo->id.flag= LIB_LOCAL; + new_id(0, (ID *)conchan->ipo, 0); + } + else { + conchan->ipo= copy_ipo(conchan->ipo); + } + } + } + } + +} + void make_local_action(bAction *act) { Object *ob; @@ -93,6 +125,7 @@ void make_local_action(bAction *act) if(act->id.us==1) { act->id.lib= 0; act->id.flag= LIB_LOCAL; + make_local_action_channels(act); new_id(0, (ID *)act, 0); return; } @@ -109,6 +142,7 @@ void make_local_action(bAction *act) if(local && lib==0) { act->id.lib= 0; act->id.flag= LIB_LOCAL; + make_local_action_channels(act); new_id(0, (ID *)act, 0); } else if(local && lib) { |