diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2019-09-07 00:33:11 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-09-07 00:33:29 +0300 |
commit | bbcb4be04fd468b8a93d919b4fc50767817ef701 (patch) | |
tree | 0e113ba890c40641b3a30ebe91a1c6b47cc7c559 /source/blender/blenkernel/intern/gpencil.c | |
parent | 9ecbd67dfb672cd13f021c82d83aeb7ae8a8cf10 (diff) |
Fix T69597: Changing Grease Pencil Layer in Dopesheet unlocks all layers
The Dopesheet was unlocked all layers because it was using the same logic used in UI panel, but this was wrong.
Diffstat (limited to 'source/blender/blenkernel/intern/gpencil.c')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 47ed9f3bd83..9ac61c69d04 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1017,7 +1017,7 @@ void BKE_gpencil_layer_setactive(bGPdata *gpd, bGPDlayer *active) } /* Set locked layers for autolock mode. */ -void BKE_gpencil_layer_autolock_set(bGPdata *gpd) +void BKE_gpencil_layer_autolock_set(bGPdata *gpd, const bool unlock) { BLI_assert(gpd != NULL); @@ -1041,8 +1041,10 @@ void BKE_gpencil_layer_autolock_set(bGPdata *gpd) /* If disable is better unlock all layers by default or it looks there is * a problem in the UI because the user expects all layers will be unlocked */ - for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { - gpl->flag &= ~GP_LAYER_LOCKED; + if (unlock) { + for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { + gpl->flag &= ~GP_LAYER_LOCKED; + } } } } |