[Bf-blender-cvs] [27357cfee03] asset-lite-greasepencil: If multiframe is disabled, only export active frame

Antonio Vazquez noreply at git.blender.org
Fri Jun 24 17:12:57 CEST 2022


Commit: 27357cfee03a8537204652e6b230f2a341d6d83a
Author: Antonio Vazquez
Date:   Fri Jun 24 17:03:17 2022 +0200
Branches: asset-lite-greasepencil
https://developer.blender.org/rB27357cfee03a8537204652e6b230f2a341d6d83a

If multiframe is disabled, only export active frame

If the other frames are hidden it can be strange to export something not visible.

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

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 a8ef9a08fb5..e0a3f5face9 100644
--- a/source/blender/editors/gpencil/gpencil_asset.c
+++ b/source/blender/editors/gpencil/gpencil_asset.c
@@ -151,6 +151,7 @@ static bool gpencil_asset_create(const bContext *C,
 {
   Main *bmain = CTX_data_main(C);
   bool non_supported_feature = false;
+  const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd_src);
 
   /* Create a copy of selected data block. */
   bGPdata *gpd = (bGPdata *)BKE_id_copy(bmain, &gpd_src->id);
@@ -209,8 +210,10 @@ static bool gpencil_asset_create(const bContext *C,
     const bGPDframe *gpf_active = gpl->actframe;
 
     LISTBASE_FOREACH_MUTABLE (bGPDframe *, gpf, &gpl->frames) {
-      /* If Active Frame mode, delete non active frames. */
-      if ((ELEM(mode, GP_ASSET_MODE_ACTIVE_FRAME, GP_ASSET_MODE_ACTIVE_FRAME_ALL_LAYERS)) &&
+      /* If Active Frame mode, delete non active frames or if multi frame edition is not enabled.
+       */
+      if ((ELEM(mode, GP_ASSET_MODE_ACTIVE_FRAME, GP_ASSET_MODE_ACTIVE_FRAME_ALL_LAYERS) ||
+           !is_multiedit) &&
           (gpf != gpf_active)) {
         BKE_gpencil_layer_frame_delete(gpl, gpf);
         continue;



More information about the Bf-blender-cvs mailing list