From e83807ef85fdc5d2f2cc83c95fa086f3a7ea5bc4 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Tue, 16 Apr 2024 04:26:52 -0700 Subject: [PATCH] Fix incorrect name of Basis global scale getter --- core/math/basis.cpp | 2 +- core/math/basis.h | 2 +- editor/import/3d/post_import_plugin_skeleton_rest_fixer.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/math/basis.cpp b/core/math/basis.cpp index 84ac878172a..34ed1c2d855 100644 --- a/core/math/basis.cpp +++ b/core/math/basis.cpp @@ -293,7 +293,7 @@ Vector3 Basis::get_scale_abs() const { Vector3(rows[0][2], rows[1][2], rows[2][2]).length()); } -Vector3 Basis::get_scale_local() const { +Vector3 Basis::get_scale_global() const { real_t det_sign = SIGN(determinant()); return det_sign * Vector3(rows[0].length(), rows[1].length(), rows[2].length()); } diff --git a/core/math/basis.h b/core/math/basis.h index 79f3bda8f80..918cbc18d46 100644 --- a/core/math/basis.h +++ b/core/math/basis.h @@ -103,7 +103,7 @@ struct _NO_DISCARD_ Basis { Vector3 get_scale() const; Vector3 get_scale_abs() const; - Vector3 get_scale_local() const; + Vector3 get_scale_global() const; void set_axis_angle_scale(const Vector3 &p_axis, real_t p_angle, const Vector3 &p_scale); void set_euler_scale(const Vector3 &p_euler, const Vector3 &p_scale, EulerOrder p_order = EulerOrder::YXZ); diff --git a/editor/import/3d/post_import_plugin_skeleton_rest_fixer.cpp b/editor/import/3d/post_import_plugin_skeleton_rest_fixer.cpp index 251834f42fc..44016292b15 100644 --- a/editor/import/3d/post_import_plugin_skeleton_rest_fixer.cpp +++ b/editor/import/3d/post_import_plugin_skeleton_rest_fixer.cpp @@ -109,7 +109,7 @@ void PostImportPluginSkeletonRestFixer::internal_process(InternalImportCategory // Apply node transforms. if (bool(p_options["retarget/rest_fixer/apply_node_transforms"])) { - Vector3 scl = global_transform.basis.get_scale_local(); + Vector3 scl = global_transform.basis.get_scale_global(); Vector bones_to_process = src_skeleton->get_parentless_bones(); for (int i = 0; i < bones_to_process.size(); i++) { @@ -674,7 +674,7 @@ void PostImportPluginSkeletonRestFixer::internal_process(InternalImportCategory int bone_idx = src_skeleton->find_bone(bn); if (bone_idx >= 0) { Transform3D adjust_transform = src_skeleton->get_bone_global_rest(bone_idx).affine_inverse() * silhouette_diff[bone_idx].affine_inverse() * pre_silhouette_skeleton_global_rest[bone_idx]; - adjust_transform.scale(global_transform.basis.get_scale_local()); + adjust_transform.scale(global_transform.basis.get_scale_global()); skin->set_bind_pose(i, adjust_transform * skin->get_bind_pose(i)); } } @@ -691,7 +691,7 @@ void PostImportPluginSkeletonRestFixer::internal_process(InternalImportCategory } ERR_CONTINUE(bone_idx < 0 || bone_idx >= src_skeleton->get_bone_count()); Transform3D adjust_transform = src_skeleton->get_bone_global_rest(bone_idx).affine_inverse() * silhouette_diff[bone_idx].affine_inverse() * pre_silhouette_skeleton_global_rest[bone_idx]; - adjust_transform.scale(global_transform.basis.get_scale_local()); + adjust_transform.scale(global_transform.basis.get_scale_global()); TypedArray child_nodes = attachment->get_children(); while (child_nodes.size()) {