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:
authorAntonioya <blendergit@gmail.com>2018-10-31 13:00:02 +0300
committerAntonioya <blendergit@gmail.com>2018-10-31 13:00:28 +0300
commit14e1dfda4e145fb4d6975fd1531fad149b761bbb (patch)
treea6f4811ddf599540f871c77a1dd9d0c918e55951 /source/blender/blenkernel
parent7bc84559aa80841591f1ccf5c09f843931d6dabb (diff)
GP: New Autolock Inactive Layer
This option locks any layer no active to avoid any accidental change.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/gpencil.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 97aed40e998..63d7f3697f0 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -996,11 +996,18 @@ void BKE_gpencil_layer_setactive(bGPdata *gpd, bGPDlayer *active)
return;
/* loop over layers deactivating all */
- for (gpl = gpd->layers.first; gpl; gpl = gpl->next)
+ for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
gpl->flag &= ~GP_LAYER_ACTIVE;
+ if (gpd->flag & GP_DATA_AUTOLOCK_LAYERS) {
+ gpl->flag |= GP_LAYER_LOCKED;
+ }
+ }
/* set as active one */
active->flag |= GP_LAYER_ACTIVE;
+ if (gpd->flag & GP_DATA_AUTOLOCK_LAYERS) {
+ active->flag &= ~GP_LAYER_LOCKED;
+ }
}
/* delete the active gp-layer */