From 761579ab1a6581cf733d275f0b5492716fddb5c0 Mon Sep 17 00:00:00 2001 From: Perfare Date: Tue, 18 Dec 2018 09:59:48 +0800 Subject: [PATCH] Fixed bug --- AssetStudioUtility/ModelConverter.cs | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/AssetStudioUtility/ModelConverter.cs b/AssetStudioUtility/ModelConverter.cs index 5dcc71d..c31f21e 100644 --- a/AssetStudioUtility/ModelConverter.cs +++ b/AssetStudioUtility/ModelConverter.cs @@ -397,23 +397,12 @@ namespace AssetStudio bone.Name = m_GameObject.m_Name; } } - if (string.IsNullOrEmpty(bone.Name)) + if (!string.IsNullOrEmpty(bone.Name)) { - var boneHash = mesh.m_BoneNameHashes[i]; - bone.Name = GetNameFromBonePathHashes(boneHash); - if (string.IsNullOrEmpty(bone.Name)) - { - bone.Name = avatar?.FindBoneName(boneHash); - } - if (string.IsNullOrEmpty(bone.Name)) - { - //throw new Exception("A Bone could neither be found by hash in Avatar nor by index in SkinnedMeshRenderer."); - continue; - } + var convert = Matrix.Scaling(new Vector3(-1, 1, 1)); + bone.Matrix = convert * Matrix.Transpose(mesh.m_BindPose[i]) * convert; + iMesh.BoneList.Add(bone); } - var convert = Matrix.Scaling(new Vector3(-1, 1, 1)); - bone.Matrix = convert * Matrix.Transpose(mesh.m_BindPose[i]) * convert; - iMesh.BoneList.Add(bone); } }