[Bf-blender-cvs] [44c97e6d2a8] asset-greasepencil: GPencil: Exclude hidden layers
Antonio Vazquez
noreply at git.blender.org
Fri Jul 23 12:25:03 CEST 2021
Commit: 44c97e6d2a8ddbaa2e3d2a3fe29614781a3aff97
Author: Antonio Vazquez
Date: Fri Jul 23 12:24:50 2021 +0200
Branches: asset-greasepencil
https://developer.blender.org/rB44c97e6d2a8ddbaa2e3d2a3fe29614781a3aff97
GPencil: Exclude hidden layers
===================================================================
M source/blender/editors/gpencil/gpencil_asset.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_asset.c b/source/blender/editors/gpencil/gpencil_asset.c
index 3c5742cfd4a..5d91e155d08 100644
--- a/source/blender/editors/gpencil/gpencil_asset.c
+++ b/source/blender/editors/gpencil/gpencil_asset.c
@@ -237,6 +237,11 @@ static void gpencil_asset_create(bContext *C,
bGPDlayer *gpl_active = BKE_gpencil_layer_active_get(gpd);
LISTBASE_FOREACH_MUTABLE (bGPDlayer *, gpl, &gpd->layers) {
+ /* If layer is hidden, remove. */
+ if (gpl->flag & GP_LAYER_HIDE) {
+ BKE_gpencil_layer_delete(gpd, gpl);
+ continue;
+ }
/* If Layer or Active Frame mode, delete non active layers. */
if ((ELEM(mode, GP_ASSET_MODE_LAYER, GP_ASSET_MODE_FRAME)) && (gpl != gpl_active)) {
BKE_gpencil_layer_delete(gpd, gpl);
More information about the Bf-blender-cvs
mailing list