diff options
author | Joshua Leung <aligorith@gmail.com> | 2016-02-08 16:44:02 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2016-02-08 16:45:36 +0300 |
commit | 52668c56b74f75c45a6b5176704dfd168fd3e6ac (patch) | |
tree | c818559d81985570dafa5ea746d25740af37b669 /source/blender/editors/transform/transform_conversions.c | |
parent | 4bc070a5193f927551a7c2aebb8c6306308bee4e (diff) |
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
Diffstat (limited to 'source/blender/editors/transform/transform_conversions.c')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 8 |
1 files changed, 2 insertions, 6 deletions
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; |