diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2019-09-03 19:58:57 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-09-03 19:59:12 +0300 |
commit | 1abb1ba9a353b5d377da20ae4b41d3cf3439857a (patch) | |
tree | 364c177747bd45973698a54b160e25a61377b4e3 /source/blender/makesrna | |
parent | e91ea20ebee800600ec073f9738b448778372453 (diff) |
GPencil: Fix unreported autolock layers using Dopesheet
When select a layer in Dopesheet, the autolock layer was not working.
Now the Dopesheet code calls the function for autolock. Also some code cleanup to move the logic to new function.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_gpencil.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index bd3321377d3..01ecf2f8cae 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -151,30 +151,7 @@ static void rna_GPencil_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Pointe static void rna_GPencil_autolock(Main *bmain, Scene *scene, PointerRNA *ptr) { bGPdata *gpd = (bGPdata *)ptr->owner_id; - bGPDlayer *gpl = NULL; - - if (gpd->flag & GP_DATA_AUTOLOCK_LAYERS) { - bGPDlayer *layer = BKE_gpencil_layer_getactive(gpd); - - /* Lock all other layers */ - for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { - /* unlock active layer */ - if (gpl == layer) { - gpl->flag &= ~GP_LAYER_LOCKED; - } - else { - gpl->flag |= GP_LAYER_LOCKED; - } - } - } - else { - /* 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; - } - } + BKE_gpencil_layer_autolock_set(gpd); /* standard update */ rna_GPencil_update(bmain, scene, ptr); |