import: Fix Silhouette used incorrect index.

Fixes bind pose mistake from using i (mesh skin index) instead of bone_idx (skeleton bone index).
Fixes #76448

(cherry picked from commit d33a734ac5)
This commit is contained in:
Lyuma 2023-04-27 01:41:28 -07:00 committed by Rémi Verschelde
parent ebaf3cc9ab
commit 2a0597d0cb
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 1 additions and 1 deletions

View File

@ -669,7 +669,7 @@ void PostImportPluginSkeletonRestFixer::internal_process(InternalImportCategory
StringName bn = skin->get_bind_name(i);
int bone_idx = src_skeleton->find_bone(bn);
if (bone_idx >= 0) {
Transform3D new_rest = silhouette_diff[i] * src_skeleton->get_bone_global_rest(bone_idx);
Transform3D new_rest = silhouette_diff[bone_idx] * src_skeleton->get_bone_global_rest(bone_idx);
skin->set_bind_pose(i, new_rest.inverse() * ibm_diff[bone_idx]);
}
}