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
This commit is contained in:
Philipp Oeser 2021-08-31 11:40:02 +02:00
parent f6d133e2d2
commit af7233368d
Notes: blender-bot 2023-02-14 00:20:15 +01:00
Referenced by issue #88449: Blender LTS: Maintenance Task 2.93
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
Referenced by issue #91060, GPencil Time Offset Modifier together with Armature Modifier or/and Lattice Modifier broken in 2.93.3
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}