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>2020-02-17 12:49:27 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-02-17 12:51:56 +0300
commit340f452da8c6bfc3a6d8136a0e2e7da7ef1fc66c (patch)
tree0008266c7db7156b47a2af44a90a83850ab87e76 /source/blender
parenta6755f2f1f0823e028cc80c1d4248205dd334d1c (diff)
GPencil: Fix unreported move to layer with lock material
The strokes with the material locked could be moved. Now the lock is respected.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index b5a34606bf3..250ceaf884f 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -1441,7 +1441,8 @@ void GPENCIL_OT_paste(wmOperatorType *ot)
static int gp_move_to_layer_exec(bContext *C, wmOperator *op)
{
- bGPdata *gpd = CTX_data_gpencil_data(C);
+ Object *ob = CTX_data_active_object(C);
+ bGPdata *gpd = (bGPdata *)ob->data;
Scene *scene = CTX_data_scene(C);
bGPDlayer *target_layer = NULL;
ListBase strokes = {NULL, NULL};
@@ -1492,6 +1493,11 @@ static int gp_move_to_layer_exec(bContext *C, wmOperator *op)
continue;
}
+ /* Check if the color is editable. */
+ if (ED_gpencil_stroke_color_use(ob, gpl, gps) == false) {
+ continue;
+ }
+
/* TODO: Don't just move entire strokes - instead, only copy the selected portions... */
if (gps->flag & GP_STROKE_SELECT) {
BLI_remlink(&gpf->strokes, gps);