From cea8f024eccae3860086aa2b1f65df28dbdf69db Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 29 Aug 2016 16:27:23 +1200 Subject: [PATCH] Fix: GPencil Paste couldn't be used to paste strokes from one datablock to another This was because the poll callback was checking for the presence of an active layer. If you just create an empty datablock and try to paste, nothing would happen. However, this check was kindof redundant anyway, as the operator would add a layer for you if it didn't find one. --- source/blender/editors/gpencil/gpencil_edit.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index d308d3ae5f1..a80600fb60c 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -432,10 +432,12 @@ void GPENCIL_OT_copy(wmOperatorType *ot) static int gp_strokes_paste_poll(bContext *C) { - /* 1) Must have GP layer to paste to... + /* 1) Must have GP datablock to paste to + * - We don't need to have an active layer though, as that can easily get added + * - If the active layer is locked, we can't paste there, but that should prompt a warning instead * 2) Copy buffer must at least have something (though it may be the wrong sort...) */ - return (CTX_data_active_gpencil_layer(C) != NULL) && (!BLI_listbase_is_empty(&gp_strokes_copypastebuf)); + return (ED_gpencil_data_get_active(C) != NULL) && (!BLI_listbase_is_empty(&gp_strokes_copypastebuf)); } enum {