[Bf-blender-cvs] [f3bf87e5887] master: GPencil: Small frame evaluation speed up improvement

Antonio Vazquez noreply at git.blender.org
Thu Feb 18 18:30:29 CET 2021


Commit: f3bf87e5887c6fedb6d8f995eb636695e3990353
Author: Antonio Vazquez
Date:   Thu Feb 18 18:30:07 2021 +0100
Branches: master
https://developer.blender.org/rBf3bf87e5887c6fedb6d8f995eb636695e3990353

GPencil: Small frame evaluation speed up improvement

Avoid look for frame if the actual frame is already available.

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

M	source/blender/blenkernel/intern/gpencil_modifier.c

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

diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c
index 8b12e1b5fca..6f1896f055a 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -656,10 +656,12 @@ static void gpencil_copy_activeframe_to_eval(
   LISTBASE_FOREACH (bGPDlayer *, gpl_orig, &gpd_orig->layers) {
 
     if (gpl_eval != NULL) {
-      int remap_cfra = gpencil_remap_time_get(depsgraph, scene, ob, gpl_orig);
+      bGPDframe *gpf_orig = gpl_orig->actframe;
 
-      bGPDframe *gpf_orig = BKE_gpencil_layer_frame_get(
-          gpl_orig, remap_cfra, GP_GETFRAME_USE_PREV);
+      int remap_cfra = gpencil_remap_time_get(depsgraph, scene, ob, gpl_orig);
+      if (gpf_orig && gpf_orig->framenum != remap_cfra) {
+        gpf_orig = BKE_gpencil_layer_frame_get(gpl_orig, remap_cfra, GP_GETFRAME_USE_PREV);
+      }
 
       if (gpf_orig != NULL) {
         int gpf_index = BLI_findindex(&gpl_orig->frames, gpf_orig);



More information about the Bf-blender-cvs mailing list