Fix #118837: Time offset modifier not working as expected #118842

Merged
Falk David merged 1 commits from filedescriptor/blender:fix-118837 into main 2024-02-28 11:30:52 +01:00
1 changed files with 23 additions and 2 deletions
Showing only changes of commit 0cc2c7d4a3 - Show all commits

View File

@ -1368,11 +1368,32 @@ static void grease_pencil_evaluate_modifiers(Depsgraph *depsgraph,
VirtualModifierData virtualModifierData;
ModifierData *md = BKE_modifiers_get_virtual_modifierlist(object, &virtualModifierData);
/* Evaluate modifiers. */
/* Evaluate time modifiers.
* The time offset modifier can change what drawings are shown on the current frame. But it
* doesn't affect the drawings data. Modifiers that modify the drawings data are only evaluated
* for the current frame, so we run the time offset modifiers before all the other ones. */
ModifierData *tmd = md;
for (; tmd; tmd = tmd->next) {
const ModifierTypeInfo *mti = BKE_modifier_get_info(ModifierType(tmd->type));
if (!BKE_modifier_is_enabled(scene, tmd, required_mode) ||
ModifierType(tmd->type) != eModifierType_GreasePencilTime)
{
continue;
}
if (mti->modify_geometry_set != nullptr) {
mti->modify_geometry_set(tmd, &mectx, &geometry_set);
}
}
/* Evaluate drawing modifiers. */
for (; md; md = md->next) {
const ModifierTypeInfo *mti = BKE_modifier_get_info(ModifierType(md->type));
if (!BKE_modifier_is_enabled(scene, md, required_mode)) {
if (!BKE_modifier_is_enabled(scene, md, required_mode) ||
ModifierType(md->type) == eModifierType_GreasePencilTime)
{
continue;
}