[Bf-blender-cvs] [af7233368de] master: Fix T91060: GPencil Time Offset Modifier breaks evaluation time

Philipp Oeser noreply at git.blender.org
Tue Aug 31 12:12:34 CEST 2021


Commit: af7233368de4eee5b7f0e34b0ff77436d4f9b312
Author: Philipp Oeser
Date:   Tue Aug 31 11:40:02 2021 +0200
Branches: master
https://developer.blender.org/rBaf7233368de4eee5b7f0e34b0ff77436d4f9b312

Fix T91060: GPencil Time Offset Modifier breaks evaluation time

Caused by {rBf3bf87e5887c}.

When using a GPencil Time Offset Modifier, the bGPDlayer>actframe can be
NULL. This can be determined though, but above optimization commit
skipped getting the active frame in this case entirely (with the
intention to only get it if framenumbers did not match).

Now also call BKE_gpencil_layer_frame_get() if actframe is NULL in order
to fetch a valid one if present.

Maniphest Tasks: T91060

Differential Revision: https://developer.blender.org/D12355

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

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 eac6a05d33a..a30376b9bad 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -719,7 +719,7 @@ static void gpencil_copy_activeframe_to_eval(
       bGPDframe *gpf_orig = gpl_orig->actframe;
 
       int remap_cfra = gpencil_remap_time_get(depsgraph, scene, ob, gpl_orig);
-      if (gpf_orig && gpf_orig->framenum != remap_cfra) {
+      if ((gpf_orig == NULL) || (gpf_orig && gpf_orig->framenum != remap_cfra)) {
         gpf_orig = BKE_gpencil_layer_frame_get(gpl_orig, remap_cfra, GP_GETFRAME_USE_PREV);
       }



More information about the Bf-blender-cvs mailing list