Skip to content

Commit

Permalink
Fix root joint being treated as the armature instead of a bone
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Aug 6, 2020
1 parent c6ff9c3 commit ff799aa
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions SuperBMDLib/source/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,29 @@ public void ExportAssImp(string fileName, string modelType, ExportSettings setti
test.WriteLine(line);
test.Flush();
}
else if (line.Contains("<node"))
{
Regex reg = new Regex("^( +)<node id=\"([^\"]+)\" +name=\"[^\"]+\" +type=\"NODE\">$");
Match match = reg.Match(line);

if (match.Success)
{
string indentation = match.Groups[1].Value;
string joint_name = match.Groups[2].Value;
if (Joints.FlatSkeleton.Exists(x => x.Name == joint_name))
{
string jointLine = indentation + $"<node id=\"{joint_name}\" name=\"{joint_name}\" sid=\"{joint_name}\" type=\"JOINT\">";
test.WriteLine(jointLine);
} else
{
test.WriteLine(line);
}
} else
{
test.WriteLine(line);
}
test.Flush();
}
else if (line.Contains("<material id=\""))
{
Regex reg = new Regex("^ <material id=\"([^\"]+)\" name=\"[^\"]+\">$");
Expand Down

0 comments on commit ff799aa

Please sign in to comment.