Fix: Incorrect value retrieval in simulation subframe mixing

This commit is contained in:
Hans Goudey
2023-05-12 10:40:51 -04:00
parent 84c5953882
commit 6491387fba

View File

@@ -607,12 +607,12 @@ static void mix_simulation_state(const NodeSimulationItem &item,
break;
}
void *prev = value_or_field_type.get_value_ptr(prev);
const void *next = value_or_field_type.get_value_ptr(next);
void *prev_value = value_or_field_type.get_value_ptr(prev);
const void *next_value = value_or_field_type.get_value_ptr(next);
bke::attribute_math::convert_to_static_type(value_or_field_type.value, [&](auto dummy) {
using T = decltype(dummy);
*static_cast<T *>(prev) = bke::attribute_math::mix2(
factor, *static_cast<T *>(prev), *static_cast<const T *>(next));
*static_cast<T *>(prev_value) = bke::attribute_math::mix2(
factor, *static_cast<T *>(prev_value), *static_cast<const T *>(next_value));
});
break;
}