ModelImporter - Update BOX2ANIM

This commit is contained in:
miku-666
2024-05-20 13:22:06 +02:00
parent cbe4796da6
commit 3f8fbfa56c

View File

@@ -1,24 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using PckStudio.External.Format;
using PckStudio.Forms.Additional_Popups;
using System.Windows.Forms;
using PckStudio.Properties;
using System.IO;
using PckStudio.Extensions;
using System.Linq;
using System.Numerics;
using PckStudio.Internal.FileFormats;
using PckStudio.Internal.IO.PSM;
using Microsoft.Win32;
using Newtonsoft.Json.Linq;
using PckStudio.Rendering;
using System.Diagnostics;
using System.Xml.Linq;
using System.Windows.Forms;
using System.Drawing.Imaging;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PckStudio.Rendering;
using PckStudio.Extensions;
using PckStudio.External.Format;
using PckStudio.Internal.IO.PSM;
using PckStudio.Internal.FileFormats;
using PckStudio.Forms.Additional_Popups;
namespace PckStudio.Internal
{
@@ -179,7 +175,7 @@ namespace PckStudio.Internal
if (box.IsBasePart() && ((boxType == "HEAD" && element.Inflate == 0.5f) || (element.Inflate >= 0.25f && element.Inflate <= 0.5f)))
box.Type = box.GetOverlayType();
if (!BOX2ANIM(box, ref modelInfo))
if (!BOX2ANIM(modelInfo.ANIM, box))
modelInfo.AdditionalBoxes.Add(box);
}
@@ -377,7 +373,7 @@ namespace PckStudio.Internal
{
skinBox.HideWithArmor = true;
}
if (!BOX2ANIM(skinBox, ref modelInfo))
if (!BOX2ANIM(modelInfo.ANIM, skinBox))
modelInfo.AdditionalBoxes.Add(skinBox);
}
}
@@ -506,12 +502,12 @@ namespace PckStudio.Internal
}
}
internal static bool BOX2ANIM(SkinBOX box, ref SkinModelInfo modelInfo)
internal static bool BOX2ANIM(SkinANIM anim, SkinBOX box)
{
int hash = box.GetHashCode();
if (SkinBOX.KnownHashes.ContainsKey(hash))
{
modelInfo.ANIM.SetFlag(SkinBOX.KnownHashes[hash], false);
anim.SetFlag(SkinBOX.KnownHashes[hash], false);
return true;
}
return false;