BFRES : Add a quick fix for swapping skeletons with regenerated indices

This commit is contained in:
KillzXGaming 2021-04-18 20:16:27 -04:00
parent 2f2bee744b
commit 7c9d8cfd98

View file

@ -432,18 +432,28 @@ namespace Bfres.Structs
if (extension == ".bfskl") if (extension == ".bfskl")
{ {
//Todo regenerate indices.
//This will just fix swapping the same bonesets with slightly adjusted indices
if (SkeletonU != null) if (SkeletonU != null)
{ {
var indices = this.SkeletonU.MatrixToBoneList;
SkeletonU = new ResU.Skeleton(); SkeletonU = new ResU.Skeleton();
SkeletonU.Import(FileName, GetResFileU()); SkeletonU.Import(FileName, GetResFileU());
SkeletonU.MatrixToBoneList = indices;
Nodes.Clear(); Nodes.Clear();
fskl.bones.Clear(); fskl.bones.Clear();
BfresWiiU.ReadSkeleton(this, SkeletonU, fskl); BfresWiiU.ReadSkeleton(this, SkeletonU, fskl);
} }
else else
{ {
var indices = this.SkeletonU.MatrixToBoneList;
Skeleton = new Skeleton(); Skeleton = new Skeleton();
Skeleton.Import(FileName); Skeleton.Import(FileName);
SkeletonU.MatrixToBoneList = indices;
Nodes.Clear(); Nodes.Clear();
fskl.bones.Clear(); fskl.bones.Clear();
BfresSwitch.ReadSkeleton(this, Skeleton, fskl); BfresSwitch.ReadSkeleton(this, Skeleton, fskl);