mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-27 06:50:23 +00:00
Add errors if a bone does not exist from an imported model.
This commit is contained in:
parent
02b4c1682c
commit
8fbd734096
7 changed files with 25 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -622,7 +622,15 @@ namespace Bfres.Structs
|
|||
shape.CreateIndexList(obj, this);
|
||||
shape.ApplyImportSettings(csvsettings, GetMaterial(shape.MaterialIndex));
|
||||
shape.BoneIndices = shape.GetIndices(Skeleton);
|
||||
|
||||
shape.VertexSkinCount = obj.GetMaxSkinInfluenceCount();
|
||||
if (shape.VertexSkinCount == 1)
|
||||
{
|
||||
int boneIndex = shape.BoneIndices[0];
|
||||
shape.BoneIndex = boneIndex;
|
||||
}
|
||||
Console.WriteLine($"VertexSkinCount {shape.VertexSkinCount}");
|
||||
|
||||
shape.SaveShape(IsWiiU);
|
||||
shape.SaveVertexBuffer();
|
||||
|
||||
|
|
|
@ -726,17 +726,23 @@ namespace Bfres.Structs
|
|||
CurNode++;
|
||||
}
|
||||
|
||||
List<string> BonesNotMatched = new List<string>();
|
||||
|
||||
int vtxIndex = 0;
|
||||
foreach (Vertex v in ob.vertices)
|
||||
{
|
||||
List<int> RigidIds = new List<int>();
|
||||
foreach (string bn in v.boneNames)
|
||||
{
|
||||
bool HasMatch = false;
|
||||
|
||||
int i = 0;
|
||||
foreach (var defBn in nodeArrStrings.Select((Value, Index) => new { Value, Index }))
|
||||
{
|
||||
if (bn == defBn.Value)
|
||||
{
|
||||
HasMatch = true;
|
||||
|
||||
//Add these after smooth matrices
|
||||
if (nodeRigidIndex[i] != -1)
|
||||
{
|
||||
|
@ -753,7 +759,14 @@ namespace Bfres.Structs
|
|||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!HasMatch && !BonesNotMatched.Contains(bn))
|
||||
{
|
||||
BonesNotMatched.Add(bn);
|
||||
STConsole.WriteLine($"No bone matches {bn}. Vertices will remain unmapped for this bone!", System.Drawing.Color.Red);
|
||||
}
|
||||
}
|
||||
|
||||
if (RigidIds.Count > 0)
|
||||
{
|
||||
foreach (int id in RigidIds)
|
||||
|
@ -762,7 +775,11 @@ namespace Bfres.Structs
|
|||
v.boneIds.Add(id);
|
||||
}
|
||||
}
|
||||
|
||||
vtxIndex++;
|
||||
}
|
||||
|
||||
BonesNotMatched.Clear();
|
||||
}
|
||||
public void CreateNewBoundingBoxes()
|
||||
{
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue