[Bf-blender-cvs] [1dee511a230] asset-greasepencil: Check Autokey Button

Antonio Vazquez noreply at git.blender.org
Mon Nov 15 18:53:00 CET 2021


Commit: 1dee511a230c13e318aa3f2192a046b48f94ad88
Author: Antonio Vazquez
Date:   Mon Nov 15 18:52:51 2021 +0100
Branches: asset-greasepencil
https://developer.blender.org/rB1dee511a230c13e318aa3f2192a046b48f94ad88

Check Autokey Button

If the autokey is disabled, the asset try to use existing active frame, but if it's not found, a new frame is created.

Whe Autokey is enabled, the new frame is always created if not existing frame.

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

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

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

diff --git a/source/blender/editors/gpencil/gpencil_asset.c b/source/blender/editors/gpencil/gpencil_asset.c
index f7bd8f3d479..c2e24140798 100644
--- a/source/blender/editors/gpencil/gpencil_asset.c
+++ b/source/blender/editors/gpencil/gpencil_asset.c
@@ -54,6 +54,7 @@
 
 #include "ED_asset.h"
 #include "ED_gpencil.h"
+#include "ED_keyframing.h"
 #include "ED_screen.h"
 #include "ED_space_api.h"
 
@@ -1019,6 +1020,12 @@ static bool gpencil_asset_append_strokes(tGPDasset *tgpa)
       }
 
       bool is_new_gpf = false;
+      /* Check Rec button. If button is disabled, try to use active frame.
+       * If no active keyframe, must create a new frame. */
+      if ((gpf_target == NULL) && (!IS_AUTOKEY_ON(tgpa->scene))) {
+        gpf_target = BKE_gpencil_layer_frame_get(gpl_target, fra, GP_GETFRAME_USE_PREV);
+      }
+
       if (gpf_target == NULL) {
         gpf_target = BKE_gpencil_frame_addnew(gpl_target, fra);
         gpl_target->actframe = gpf_target;



More information about the Bf-blender-cvs mailing list