GPencil: Layers with alpha = 0 should not be editable
[blender.git] / source / blender / editors / transform / transform_conversions.c
index ab0db79d460607c71d4362d6b5ff5dd3e82bec84..03e3fa02d123fba2a24a6aaff1061854a854a490 100644 (file)
@@ -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;