diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-12-19 05:49:58 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-12-19 05:49:58 +0400 |
commit | d433cd65f7127d60e17d05a824290423ad226eae (patch) | |
tree | f0a9c821f6046e97b74c6969d41269b558fd52ab /source/blender/editors/animation/anim_channels_edit.c | |
parent | 10f0f66560234a04aed3295c74fff20adacbc57f (diff) | |
parent | f10dea7e3b9b431edae9c787fa1a9e09cd567ed7 (diff) |
Merged changes in the trunk up to revision 53146.
Conflicts resolved:
release/datafiles/startup.blend
source/blender/blenkernel/CMakeLists.txt
source/blender/blenlib/intern/bpath.c
source/blender/blenloader/intern/readfile.c
Diffstat (limited to 'source/blender/editors/animation/anim_channels_edit.c')
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index bb324337ffb..466bb178136 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -542,12 +542,26 @@ void ANIM_fcurve_delete_from_animdata(bAnimContext *ac, AnimData *adt, FCurve *f BLI_remlink(&adt->drivers, fcu); } else if (adt->action) { + bAction *act = adt->action; + /* remove from group or action, whichever one "owns" the F-Curve */ - if (fcu->grp) - action_groups_remove_channel(adt->action, fcu); - else - BLI_remlink(&adt->action->curves, fcu); + if (fcu->grp) { + bActionGroup *agrp = fcu->grp; + + /* remove F-Curve from group+action */ + action_groups_remove_channel(act, fcu); + /* if group has no more channels, remove it too, + * otherwise can have many dangling groups [#33541] + */ + if (agrp->channels.first == NULL) { + BLI_freelinkN(&act->groups, agrp); + } + } + else { + BLI_remlink(&act->curves, fcu); + } + /* if action has no more F-Curves as a result of this, unlink it from * AnimData if it did not come from a NLA Strip being tweaked. * @@ -555,12 +569,8 @@ void ANIM_fcurve_delete_from_animdata(bAnimContext *ac, AnimData *adt, FCurve *f * channel list that are empty, and linger around long after the data they * are for has disappeared (and probably won't come back). */ - // XXX: does everybody always want this? - /* XXX: there's a problem where many actions could build up in the file if multiple - * full add/delete cycles are performed on the same objects, but assume that this is rare - */ - if ((adt->action->curves.first == NULL) && (adt->flag & ADT_NLA_EDIT_ON) == 0) { - id_us_min(&adt->action->id); + if ((act->curves.first == NULL) && (adt->flag & ADT_NLA_EDIT_ON) == 0) { + id_us_min(&act->id); adt->action = NULL; } } @@ -1230,7 +1240,7 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op)) case ANIMTYPE_MASKLAYER: { - /* Grease Pencil layer */ + /* Mask layer */ Mask *mask = (Mask *)ale->id; MaskLayer *masklay = (MaskLayer *)ale->data; |