From b0bd7531df54cd79fc45bf5573b7c283e6232138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20T=C3=B6nne?= Date: Tue, 1 Jul 2025 07:28:05 +0200 Subject: [PATCH] Fix #140558: No cache reset on every subframe of the bake range start frame The `reset_invalid_node_bakes` function resets caches on or before the first frame of the bake frame range. This works fine for full-frame steps, but with stretched-out frames the `SubFrame` comparator is true for every substep when the integer frames match. This keeps resetting the cache at the beginning of the bake range for all subframes. The comparison function must take the subframe into account when the integer part is equal. Pull Request: https://projects.blender.org/blender/blender/pulls/141220 --- source/blender/blenlib/BLI_sub_frame.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/blenlib/BLI_sub_frame.hh b/source/blender/blenlib/BLI_sub_frame.hh index 32e5b933fda..548852420b6 100644 --- a/source/blender/blenlib/BLI_sub_frame.hh +++ b/source/blender/blenlib/BLI_sub_frame.hh @@ -78,7 +78,7 @@ struct SubFrame { friend bool operator<=(const SubFrame &a, const SubFrame &b) { - return a.frame_ <= b.frame_ || (a.frame_ == b.frame_ && a.subframe_ <= b.subframe_); + return a.frame_ < b.frame_ || (a.frame_ == b.frame_ && a.subframe_ <= b.subframe_); } friend bool operator>(const SubFrame &a, const SubFrame &b) @@ -88,7 +88,7 @@ struct SubFrame { friend bool operator>=(const SubFrame &a, const SubFrame &b) { - return a.frame_ >= b.frame_ || (a.frame_ == b.frame_ && a.subframe_ >= b.subframe_); + return a.frame_ > b.frame_ || (a.frame_ == b.frame_ && a.subframe_ >= b.subframe_); } };