Fix: normalize matrix before converting to euler

Without this, Blender aborts due to an assert.
This commit is contained in:
2023-03-12 05:55:06 +01:00
parent 54c9f972df
commit adfffb7d32

View File

@@ -22,7 +22,7 @@ class InstanceRotationFieldInput final : public bke::InstancesFieldInput {
GVArray get_varray_for_context(const bke::Instances &instances, IndexMask /*mask*/) const final
{
auto rotation_fn = [&](const int i) -> float3 {
return float3(math::to_euler(instances.transforms()[i]));
return float3(math::to_euler(math::normalize(instances.transforms()[i])));
};
return VArray<float3>::ForFunc(instances.instances_num(), rotation_fn);