diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2021-02-18 20:30:07 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2021-02-18 20:30:07 +0300 |
commit | f3bf87e5887c6fedb6d8f995eb636695e3990353 (patch) | |
tree | 4a180e804cdfd6b750099235ff2c4ab7415574f7 /source | |
parent | 62b8c2a66a379971f78c0ee0f6197fb7c3fb5a2b (diff) |
GPencil: Small frame evaluation speed up improvement
Avoid look for frame if the actual frame is already available.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil_modifier.c | 8 |
1 files changed, 5 insertions, 3 deletions
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); |