From 52668c56b74f75c45a6b5176704dfd168fd3e6ac Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 9 Feb 2016 02:44:02 +1300 Subject: GPencil: Layers with alpha = 0 should not be editable * Added a new API function to test if a GPencil layer is visible or not * Replaced all editability checks with this new "super check" * Replaced all magic number thresholds for opacity visiblity with a single define --- source/blender/editors/transform/transform_conversions.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/transform') diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index ab0db79d460..03e3fa02d12 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -7645,9 +7645,7 @@ static void createTransGPencil(bContext *C, TransInfo *t) */ for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { /* only editable and visible layers are considered */ - if ((gpl->flag & (GP_LAYER_HIDE | GP_LAYER_LOCKED)) == 0 && - (gpl->actframe != NULL)) - { + if (gpencil_layer_is_editable(gpl) && (gpl->actframe != NULL)) { bGPDframe *gpf = gpl->actframe; bGPDstroke *gps; @@ -7701,9 +7699,7 @@ static void createTransGPencil(bContext *C, TransInfo *t) /* Second Pass: Build transdata array */ for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { /* only editable and visible layers are considered */ - if ((gpl->flag & (GP_LAYER_HIDE | GP_LAYER_LOCKED)) == 0 && - (gpl->actframe != NULL)) - { + if (gpencil_layer_is_editable(gpl) && (gpl->actframe != NULL)) { bGPDframe *gpf = gpl->actframe; bGPDstroke *gps; -- cgit v1.2.3