mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-25 05:40:21 -04:00
fixed bug
This commit is contained in:
parent
f76d3d8fcd
commit
a2be5ebdac
@ -250,6 +250,7 @@ namespace AssetStudioGUI
|
||||
var item = tempDic[m_Mesh];
|
||||
item.TreeNode = currentNode;
|
||||
}
|
||||
tempDic[m_GameObject.m_MeshFilter].TreeNode = currentNode;
|
||||
}
|
||||
|
||||
if (m_GameObject.m_SkinnedMeshRenderer != null)
|
||||
@ -259,6 +260,7 @@ namespace AssetStudioGUI
|
||||
var item = tempDic[m_Mesh];
|
||||
item.TreeNode = currentNode;
|
||||
}
|
||||
tempDic[m_GameObject.m_SkinnedMeshRenderer].TreeNode = currentNode;
|
||||
}
|
||||
|
||||
var parentNode = fileNode;
|
||||
|
@ -380,21 +380,24 @@ namespace AssetStudio
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (mesh.m_BindPose.Length > 0 && mesh.m_BoneNameHashes?.Length > 0)
|
||||
if (iMesh.BoneList?.Count == 0)
|
||||
{
|
||||
var boneMax = Math.Min(mesh.m_BindPose.Length, mesh.m_BoneNameHashes.Length);
|
||||
iMesh.BoneList = new List<ImportedBone>(boneMax);
|
||||
for (int i = 0; i < boneMax; i++)
|
||||
if (mesh.m_BindPose.Length > 0 && mesh.m_BoneNameHashes?.Length > 0)
|
||||
{
|
||||
var bone = new ImportedBone();
|
||||
var boneHash = mesh.m_BoneNameHashes[i];
|
||||
var path = GetPathFromHash(boneHash);
|
||||
bone.Path = FixBonePath(path);
|
||||
if (!string.IsNullOrEmpty(bone.Path))
|
||||
var boneMax = Math.Min(mesh.m_BindPose.Length, mesh.m_BoneNameHashes.Length);
|
||||
iMesh.BoneList = new List<ImportedBone>(boneMax);
|
||||
for (int i = 0; i < boneMax; i++)
|
||||
{
|
||||
var convert = Matrix4x4.Scale(new Vector3(-1, 1, 1));
|
||||
bone.Matrix = convert * mesh.m_BindPose[i] * convert;
|
||||
iMesh.BoneList.Add(bone);
|
||||
var bone = new ImportedBone();
|
||||
var boneHash = mesh.m_BoneNameHashes[i];
|
||||
var path = GetPathFromHash(boneHash);
|
||||
bone.Path = FixBonePath(path);
|
||||
if (!string.IsNullOrEmpty(bone.Path))
|
||||
{
|
||||
var convert = Matrix4x4.Scale(new Vector3(-1, 1, 1));
|
||||
bone.Matrix = convert * mesh.m_BindPose[i] * convert;
|
||||
iMesh.BoneList.Add(bone);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -697,7 +700,7 @@ namespace AssetStudio
|
||||
{
|
||||
foreach (var m_CompressedRotationCurve in animationClip.m_CompressedRotationCurves)
|
||||
{
|
||||
var track = iAnim.FindTrack(m_CompressedRotationCurve.m_Path);
|
||||
var track = iAnim.FindTrack(FixBonePath(m_CompressedRotationCurve.m_Path));
|
||||
|
||||
var numKeys = m_CompressedRotationCurve.m_Times.m_NumItems;
|
||||
var data = m_CompressedRotationCurve.m_Times.UnpackInts();
|
||||
@ -719,7 +722,7 @@ namespace AssetStudio
|
||||
}
|
||||
foreach (var m_RotationCurve in animationClip.m_RotationCurves)
|
||||
{
|
||||
var track = iAnim.FindTrack(m_RotationCurve.path);
|
||||
var track = iAnim.FindTrack(FixBonePath(m_RotationCurve.path));
|
||||
foreach (var m_Curve in m_RotationCurve.curve.m_Curve)
|
||||
{
|
||||
var value = Fbx.QuaternionToEuler(new Quaternion(m_Curve.value.X, -m_Curve.value.Y, -m_Curve.value.Z, m_Curve.value.W));
|
||||
@ -728,7 +731,7 @@ namespace AssetStudio
|
||||
}
|
||||
foreach (var m_PositionCurve in animationClip.m_PositionCurves)
|
||||
{
|
||||
var track = iAnim.FindTrack(m_PositionCurve.path);
|
||||
var track = iAnim.FindTrack(FixBonePath(m_PositionCurve.path));
|
||||
foreach (var m_Curve in m_PositionCurve.curve.m_Curve)
|
||||
{
|
||||
track.Translations.Add(new ImportedKeyframe<Vector3>(m_Curve.time, new Vector3(-m_Curve.value.X, m_Curve.value.Y, m_Curve.value.Z)));
|
||||
@ -736,7 +739,7 @@ namespace AssetStudio
|
||||
}
|
||||
foreach (var m_ScaleCurve in animationClip.m_ScaleCurves)
|
||||
{
|
||||
var track = iAnim.FindTrack(m_ScaleCurve.path);
|
||||
var track = iAnim.FindTrack(FixBonePath(m_ScaleCurve.path));
|
||||
foreach (var m_Curve in m_ScaleCurve.curve.m_Curve)
|
||||
{
|
||||
track.Scalings.Add(new ImportedKeyframe<Vector3>(m_Curve.time, new Vector3(m_Curve.value.X, m_Curve.value.Y, m_Curve.value.Z)));
|
||||
@ -746,7 +749,7 @@ namespace AssetStudio
|
||||
{
|
||||
foreach (var m_EulerCurve in animationClip.m_EulerCurves)
|
||||
{
|
||||
var track = iAnim.FindTrack(m_EulerCurve.path);
|
||||
var track = iAnim.FindTrack(FixBonePath(m_EulerCurve.path));
|
||||
foreach (var m_Curve in m_EulerCurve.curve.m_Curve)
|
||||
{
|
||||
track.Rotations.Add(new ImportedKeyframe<Vector3>(m_Curve.time, new Vector3(m_Curve.value.X, -m_Curve.value.Y, -m_Curve.value.Z)));
|
||||
|
Loading…
Reference in New Issue
Block a user