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>2022-09-12 13:13:07 +0300
committerAntonio Vazquez <blendergit@gmail.com>2022-09-12 13:13:07 +0300
commit2d069b609b98274b08ad0515a32457e4bd8f757e (patch)
tree6c8ef3c0e590ca2e5d581aed1252c5847b5d5f12
parent33abb68cf20c91e6013f009e6e3f06bcd5bec410 (diff)
Fix T100999: GPencil Copy paste stroke(s) does not respect autokeying
The operator was not checking the status of the Autokey button.
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 89ab9eda7f0..d28cefd4887 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -67,6 +67,7 @@
#include "ED_armature.h"
#include "ED_gpencil.h"
+#include "ED_keyframing.h"
#include "ED_object.h"
#include "ED_outliner.h"
#include "ED_screen.h"
@@ -1715,10 +1716,15 @@ static int gpencil_strokes_paste_exec(bContext *C, wmOperator *op)
/* Ensure we have a frame to draw into
* NOTE: Since this is an op which creates strokes,
- * we are obliged to add a new frame if one
- * doesn't exist already
+ * we resuse active frame or add a new frame if one
+ * doesn't exist already depending on REC button status.
*/
- gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_ADD_NEW);
+ if (IS_AUTOKEY_ON(scene) || (gpl->actframe == NULL)) {
+ gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_ADD_NEW);
+ }
+ else {
+ gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_USE_PREV);
+ }
if (gpf) {
/* Create new stroke */
bGPDstroke *new_stroke = BKE_gpencil_stroke_duplicate(gps, true, true);