[Bf-blender-cvs] [9c773fdb7ef] asset-greasepencil: GPencil: Ensure preview is done with first frame

Antonio Vazquez noreply at git.blender.org
Sat Jul 24 00:00:54 CEST 2021


Commit: 9c773fdb7efc81f297f1ba51e7c920fd22e0a172
Author: Antonio Vazquez
Date:   Sat Jul 24 00:00:50 2021 +0200
Branches: asset-greasepencil
https://developer.blender.org/rB9c773fdb7efc81f297f1ba51e7c920fd22e0a172

GPencil: Ensure preview is done with first 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 4d255297c76..34b19a34822 100644
--- a/source/blender/editors/gpencil/gpencil_asset.c
+++ b/source/blender/editors/gpencil/gpencil_asset.c
@@ -356,15 +356,18 @@ static bool gpencil_asset_create(const bContext *C,
     strcpy(gpl_dst->info, "Asset_Layer");
   }
 
+  /* Ensure preview is done with first available frame. */
+  const int first_franum = gpencil_asset_get_first_franum(gpd);
+  CFRA = first_franum;
+
   /* Mark as asset. */
   ED_asset_mark_id(C, &gpd->id);
 
   /* Retime frame number to start by 1. Must be done after generate the render preview. */
   if (retime_frames) {
-    const int first_franum = gpencil_asset_get_first_franum(gpd) - 1;
     LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
       LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
-        gpf->framenum -= first_franum;
+        gpf->framenum -= first_franum - 1;
       }
     }
   }



More information about the Bf-blender-cvs mailing list