Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2019-09-07 00:33:11 +0300
committerAntonio Vazquez <blendergit@gmail.com>2019-09-07 00:33:29 +0300
commitbbcb4be04fd468b8a93d919b4fc50767817ef701 (patch)
tree0e113ba890c40641b3a30ebe91a1c6b47cc7c559 /source/blender/blenkernel/intern/gpencil.c
parent9ecbd67dfb672cd13f021c82d83aeb7ae8a8cf10 (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.c8
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;
+ }
}
}
}