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/screen | |
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/screen')
-rw-r--r-- | source/blender/editors/screen/screen_context.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index 8a7ee3a5fe7..f61ad348501 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -511,7 +511,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult bGPDlayer *gpl; for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { - if ((gpl->flag & (GP_LAYER_HIDE | GP_LAYER_LOCKED)) == 0) { + if (gpencil_layer_is_editable(gpl)) { CTX_data_list_add(result, &gpd->id, &RNA_GPencilLayer, gpl); } } @@ -527,7 +527,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult bGPDlayer *gpl; for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { - if ((gpl->flag & (GP_LAYER_HIDE | GP_LAYER_LOCKED)) == 0 && (gpl->actframe)) { + if (gpencil_layer_is_editable(gpl) && (gpl->actframe)) { bGPDframe *gpf = gpl->actframe; bGPDstroke *gps; |