[Bf-blender-cvs] [cea8f02] master: Fix: GPencil Paste couldn't be used to paste strokes from one datablock to another

Joshua Leung noreply at git.blender.org
Mon Aug 29 07:12:47 CEST 2016


Commit: cea8f024eccae3860086aa2b1f65df28dbdf69db
Author: Joshua Leung
Date:   Mon Aug 29 16:27:23 2016 +1200
Branches: master
https://developer.blender.org/rBcea8f024eccae3860086aa2b1f65df28dbdf69db

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.

===================================================================

M	source/blender/editors/gpencil/gpencil_edit.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index d308d3a..a80600f 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 {




More information about the Bf-blender-cvs mailing list