Revert GetActiveSkeleton() as it causes animation export issues.

Since bfres has no real way to actively tell what animation uses which skeleton, I will need to do a UI in another update to select which model to export with.
This commit is contained in:
KillzXGaming 2021-06-12 11:12:16 -04:00
parent 06e835fd3d
commit a425bd6a6e

View file

@ -227,25 +227,22 @@ namespace Bfres.Structs
private STSkeleton GetActiveSkeleton() private STSkeleton GetActiveSkeleton()
{ {
var viewport = LibraryGUI.GetActiveViewport(); var viewport = LibraryGUI.GetActiveViewport();
if (viewport != null)
{
foreach (var drawable in viewport.scene.objects) foreach (var drawable in viewport.scene.objects)
{ {
if (drawable is STSkeleton) if (drawable is STSkeleton)
{ {
bool hasMatchingBoneset = true;
foreach (var bone in Bones) foreach (var bone in Bones)
{ {
var animBone = ((STSkeleton)drawable).GetBone(bone.Text); var animBone = ((STSkeleton)drawable).GetBone(bone.Text);
if (animBone == null) {
hasMatchingBoneset = false;
continue;
}
}
//Animation has all bones present in skeleton if (animBone != null)
if (hasMatchingBoneset)
return (STSkeleton)drawable; return (STSkeleton)drawable;
} }
} }
}
}
var render = ((BFRES)Parent.Parent.Parent).BFRESRender; var render = ((BFRES)Parent.Parent.Parent).BFRESRender;
if (render.models.Count == 1) if (render.models.Count == 1)