From 3baa214c7b8233a501a3288254b83d74854c6afd Mon Sep 17 00:00:00 2001 From: Scut Date: Tue, 11 Jun 2024 02:58:02 -0400 Subject: [PATCH] fixed negative scales having mismatch between gfx and collision (#352) Co-authored-by: scut --- fast64_internal/utility.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fast64_internal/utility.py b/fast64_internal/utility.py index 9cf65c906..02beb9100 100644 --- a/fast64_internal/utility.py +++ b/fast64_internal/utility.py @@ -772,7 +772,9 @@ def yield_children(obj: bpy.types.Object): def store_original_mtx(): active_obj = bpy.context.view_layer.objects.active for obj in yield_children(active_obj): - obj["original_mtx"] = obj.matrix_local + # negative scales produce a rotation, we need to remove that since + # scales will be applied to the transform for each object + obj["original_mtx"] = Matrix.LocRotScale(obj.location, obj.rotation_euler, None) def rotate_bounds(bounds, mtx: mathutils.Matrix): @@ -800,8 +802,6 @@ def copy_object_and_apply(obj: bpy.types.Object, apply_scale=False, apply_modifi obj["instanced_mesh_name"] = obj.name obj.original_name = obj.name - if apply_scale: - obj["original_mtx"] = translation_rotation_from_mtx(mathutils.Matrix(obj["original_mtx"])) obj_copy = obj.copy() obj_copy.data = obj_copy.data.copy()