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
This commit is contained in:
@@ -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_);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user