1
0
mirror of synced 2025-01-31 12:23:52 +01:00

Fix boe importing not changing the parent index

This commit is contained in:
KillzXGaming 2019-04-27 10:55:31 -04:00
parent 7ada057843
commit 432e639081
10 changed files with 18 additions and 6 deletions

Binary file not shown.

View File

@ -259,6 +259,7 @@ namespace Bfres.Structs
{ {
ResU.Bone bone = new ResU.Bone(); ResU.Bone bone = new ResU.Bone();
bone.Import(FileName, GetResFileU()); bone.Import(FileName, GetResFileU());
bone.ParentIndex = -1;
BfresWiiU.ReadBone(bn, bone, false); BfresWiiU.ReadBone(bn, bone, false);
} }
@ -266,6 +267,7 @@ namespace Bfres.Structs
{ {
Bone bone = new Bone(); Bone bone = new Bone();
bone.Import(FileName); bone.Import(FileName);
bone.ParentIndex = -1;
BfresSwitch.ReadBone(bn, bone, false); BfresSwitch.ReadBone(bn, bone, false);
} }
@ -541,10 +543,12 @@ namespace Bfres.Structs
BoneU = new ResU.Bone(); BoneU = new ResU.Bone();
BoneU.Import(ofd.FileName, GetResFileU()); BoneU.Import(ofd.FileName, GetResFileU());
BoneU.Name = CheckDuplicateBoneNames(BoneU.Name); BoneU.Name = CheckDuplicateBoneNames(BoneU.Name);
BfresWiiU.ReadBone(bn, BoneU, false); BfresWiiU.ReadBone(bn, BoneU, false);
Nodes.Add(bn); Nodes.Add(bn);
skeletonParent.bones.Add(bn); skeletonParent.bones.Add(bn);
BoneU.ParentIndex = (short)bn.parentIndex;
((FSKL)skeletonParent).AddBone(BoneU); ((FSKL)skeletonParent).AddBone(BoneU);
} }
else else
@ -552,10 +556,12 @@ namespace Bfres.Structs
Bone = new Bone(); Bone = new Bone();
Bone.Import(ofd.FileName); Bone.Import(ofd.FileName);
Bone.Name = CheckDuplicateBoneNames(Bone.Name); Bone.Name = CheckDuplicateBoneNames(Bone.Name);
BfresSwitch.ReadBone(bn, Bone, false); BfresSwitch.ReadBone(bn, Bone, false);
Nodes.Add(bn); Nodes.Add(bn);
skeletonParent.bones.Add(bn); skeletonParent.bones.Add(bn);
BoneU.ParentIndex = (short)bn.parentIndex;
((FSKL)skeletonParent).AddBone(Bone); ((FSKL)skeletonParent).AddBone(Bone);
} }
} }

View File

@ -13,6 +13,8 @@ namespace Switch_Toolbox.Library
{ {
public class AssimpData public class AssimpData
{ {
public bool UseTransformMatrix = true;
public Scene scene; public Scene scene;
public List<STGenericObject> objects = new List<STGenericObject>(); public List<STGenericObject> objects = new List<STGenericObject>();
@ -78,11 +80,15 @@ namespace Switch_Toolbox.Library
} }
} }
private void BuildNode(Node parent, ref Matrix4x4 rootTransform) private void BuildNode(Node parent, ref Matrix4x4 rootTransform)
{
Matrix4x4 world = rootTransform;
Matrix4 worldTK = Matrix4.Identity;
if (UseTransformMatrix)
{ {
Matrix4x4 trafo = parent.Transform; Matrix4x4 trafo = parent.Transform;
Matrix4x4 world = trafo * rootTransform; world = trafo * rootTransform;
Matrix4 worldTK = AssimpHelper.TKMatrix(world); worldTK = AssimpHelper.TKMatrix(world);
}
if (parent.MeshCount > 0) if (parent.MeshCount > 0)
{ {

Binary file not shown.

Binary file not shown.