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:
authorJoshua Leung <aligorith@gmail.com>2011-07-08 15:57:25 +0400
committerJoshua Leung <aligorith@gmail.com>2011-07-08 15:57:25 +0400
commit579efb097d7fba1215de39177aaedbfa0f0e3f33 (patch)
tree153034f2a4996d0866327265ca1f36a69d2355d3 /source/blender/editors/animation/anim_channels_edit.c
parent05d6b555e8d4f5da380bc7a13e1aa863581d36e5 (diff)
Deleting Grease Pencil layers from Action-Editor works again
Diffstat (limited to 'source/blender/editors/animation/anim_channels_edit.c')
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c39
1 files changed, 26 insertions, 13 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index ff6bd3547ce..864bf8e55de 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -1171,28 +1171,41 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op))
BLI_freelistN(&anim_data);
}
- /* now do F-Curves */
- if (ac.datatype != ANIMCONT_GPENCIL) {
- /* filter data */
- filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
- ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
-
- /* delete selected F-Curves */
- for (ale= anim_data.first; ale; ale= ale->next) {
- /* only F-Curves, and only if we can identify its parent */
- if (ale->type == ANIMTYPE_FCURVE) {
+ /* filter data */
+ filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
+ ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
+
+ /* delete selected data channels */
+ for (ale= anim_data.first; ale; ale= ale->next) {
+ switch (ale->type) {
+ case ANIMTYPE_FCURVE:
+ {
+ /* F-Curves if we can identify its parent */
AnimData *adt= ale->adt;
FCurve *fcu= (FCurve *)ale->data;
/* try to free F-Curve */
ANIM_fcurve_delete_from_animdata(&ac, adt, fcu);
}
+ break;
+
+ case ANIMTYPE_GPLAYER:
+ {
+ /* Grease Pencil layer */
+ bGPdata *gpd= (bGPdata *)ale->id;
+ bGPDlayer *gpl= (bGPDlayer *)ale->data;
+
+ /* try to delete the layer's data and the layer itself */
+ free_gpencil_frames(gpl);
+ BLI_freelinkN(&gpd->layers, gpl);
+ }
+ break;
}
-
- /* cleanup */
- BLI_freelistN(&anim_data);
}
+ /* cleanup */
+ BLI_freelistN(&anim_data);
+
/* send notifier that things have changed */
WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);