From 4462100ceed78301b43dae2f75cd459b8225614a Mon Sep 17 00:00:00 2001 From: Pratik Borhade Date: Fri, 25 Aug 2023 11:00:37 +0200 Subject: [PATCH] GPv3: Delete channels Support deleting Grease pencil channels in dopesheet. `remove_layer` function is used to remove the layer from GP object. Pull Request: https://projects.blender.org/blender/blender/pulls/111426 --- source/blender/editors/animation/anim_channels_edit.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/blender/editors/animation/anim_channels_edit.cc b/source/blender/editors/animation/anim_channels_edit.cc index b52c479b1f4..556998b943e 100644 --- a/source/blender/editors/animation/anim_channels_edit.cc +++ b/source/blender/editors/animation/anim_channels_edit.cc @@ -2192,6 +2192,14 @@ static int animchannels_delete_exec(bContext *C, wmOperator * /*op*/) ale->update = ANIM_UPDATE_DEPS; break; } + case ANIMTYPE_GREASE_PENCIL_LAYER: { + using namespace blender::bke::greasepencil; + GreasePencil *grease_pencil = reinterpret_cast(ale->id); + Layer *layer = static_cast(ale->data); + grease_pencil->remove_layer(*layer); + DEG_id_tag_update(&grease_pencil->id, ID_RECALC_GEOMETRY); + break; + } case ANIMTYPE_MASKLAYER: { /* Mask layer */ Mask *mask = (Mask *)ale->id;