Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Want <cwant@ualberta.ca>2003-02-14 02:30:51 +0300
committerChris Want <cwant@ualberta.ca>2003-02-14 02:30:51 +0300
commit76396efb14a8255369d3cda6ce2522b788ec6740 (patch)
treed81527288978a1e4a762fa60413dbd8943768ad3
parent8729dfb134737131ae3d8553bcf709645eb19885 (diff)
This modification removes a bone's
action channel from the cooresponding action when the bone's IPO is deleted from the IPO window (the old behavior was to set the channel's ipo to NULL without removing it from the action). This is to alleviate the problem that there is a lot of action channel code that tries to access the channel's ipo (chan->ipo) without testing whether it is NULL or not (resulting in a segfault). This seems to be the best way to solve this problem ... unless there is a reason why it might be useful to have an action channel with no ipo attached to it? Thanks to zel365 for uncovering this problem.
-rw-r--r--source/blender/src/headerbuttons.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c
index 422b50c141c..fb91d3eed8d 100644
--- a/source/blender/src/headerbuttons.c
+++ b/source/blender/src/headerbuttons.c
@@ -1038,7 +1038,13 @@ void do_global_buttons(unsigned short event)
else if(ipo->blocktype==ID_WO) ( (World *)from)->ipo= 0;
else if(ipo->blocktype==ID_CA) ( (Camera *)from)->ipo= 0;
else if(ipo->blocktype==ID_SO) ( (bSound *)from)->ipo= 0;
- else if(ipo->blocktype==ID_AC) get_hilighted_action_channel((bAction*)from)->ipo= 0;
+ else if(ipo->blocktype==ID_AC) {
+ bAction *act = (bAction*) from;
+ bActionChannel *chan =
+ get_hilighted_action_channel((bAction*)from);
+ chan->ipo->id.us--;
+ BLI_freelinkN (&act->chanbase, chan);
+ }
else if(ipo->blocktype==IPO_CO) ((Object *)from)->activecon->ipo= 0;
else error("Warn bugs@blender.nl!");