Skip to content

Commit

Permalink
import: Fix Silhouette used incorrect index.
Browse files Browse the repository at this point in the history
Fixes bind pose mistake from using i (mesh skin index) instead of bone_idx (skeleton bone index).
Fixes godotengine#76448
  • Loading branch information
lyuma committed Apr 27, 2023
1 parent ef02571 commit d33a734
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editor/import/post_import_plugin_skeleton_rest_fixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
}
Expand Down

0 comments on commit d33a734

Please sign in to comment.