Some fixes.
Fix DAE exporting if textures fail to export. Fix bone detection for FBX Add model index for LM3 models.
This commit is contained in:
parent
9c5185bbde
commit
39d2307cd3
@ -327,7 +327,7 @@ namespace FirstPlugin.LuigisMansion3
|
|||||||
text = NLG_Common.HashNames[hashID];
|
text = NLG_Common.HashNames[hashID];
|
||||||
|
|
||||||
|
|
||||||
currentModel.Text = text;
|
currentModel.Text = $"{currentModel.Text} [{text}]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -455,7 +455,14 @@ namespace Toolbox.Library
|
|||||||
if (DaeHelper.IDMapToName.ContainsKey(node.Name))
|
if (DaeHelper.IDMapToName.ContainsKey(node.Name))
|
||||||
Name = DaeHelper.IDMapToName[node.Name];
|
Name = DaeHelper.IDMapToName[node.Name];
|
||||||
|
|
||||||
bool IsBone = false;
|
string ParentArmatureName = node.Parent != null ? node.Parent.Name : "";
|
||||||
|
if (ParentArmatureName != string.Empty && DaeHelper.IDMapToName.ContainsKey(ParentArmatureName))
|
||||||
|
ParentArmatureName = DaeHelper.IDMapToName[ParentArmatureName];
|
||||||
|
|
||||||
|
bool IsBone = boneNames.Contains(Name) && !boneNames.Contains(ParentArmatureName) ||
|
||||||
|
Name.Contains("Skl_Root") || Name.Contains("nw4f_root") ||
|
||||||
|
Name.Contains("skl_root") || Name == "Root";
|
||||||
|
|
||||||
if (DaeHelper.VisualSceneNodeTypes.ContainsKey(Name)) {
|
if (DaeHelper.VisualSceneNodeTypes.ContainsKey(Name)) {
|
||||||
if (DaeHelper.VisualSceneNodeTypes[Name] == "JOINT")
|
if (DaeHelper.VisualSceneNodeTypes[Name] == "JOINT")
|
||||||
IsBone = true;
|
IsBone = true;
|
||||||
|
@ -62,6 +62,8 @@ namespace Toolbox.Library
|
|||||||
if (Materials == null)
|
if (Materials == null)
|
||||||
Materials = new List<STGenericMaterial>();
|
Materials = new List<STGenericMaterial>();
|
||||||
|
|
||||||
|
List<string> failedTextureExport = new List<string>();
|
||||||
|
|
||||||
STProgressBar progressBar = new STProgressBar();
|
STProgressBar progressBar = new STProgressBar();
|
||||||
progressBar.Task = "Exporting Model...";
|
progressBar.Task = "Exporting Model...";
|
||||||
progressBar.Value = 0;
|
progressBar.Value = 0;
|
||||||
@ -98,14 +100,19 @@ namespace Toolbox.Library
|
|||||||
progressBar.Value = ((i * 100) / Textures.Count);
|
progressBar.Value = ((i * 100) / Textures.Count);
|
||||||
progressBar.Refresh();
|
progressBar.Refresh();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
var bitmap = Textures[i].GetBitmap();
|
var bitmap = Textures[i].GetBitmap();
|
||||||
|
if (bitmap != null)
|
||||||
|
{
|
||||||
string textureName = Textures[i].Text;
|
string textureName = Textures[i].Text;
|
||||||
if (textureName.RemoveIllegaleFileNameCharacters() != textureName)
|
if (textureName.RemoveIllegaleFileNameCharacters() != textureName)
|
||||||
{
|
{
|
||||||
string properName = textureName.RemoveIllegaleFileNameCharacters();
|
string properName = textureName.RemoveIllegaleFileNameCharacters();
|
||||||
for (int m = 0; m < Materials?.Count; m++) {
|
for (int m = 0; m < Materials?.Count; m++)
|
||||||
foreach (var tex in Materials[m].TextureMaps) {
|
{
|
||||||
|
foreach (var tex in Materials[m].TextureMaps)
|
||||||
|
{
|
||||||
if (tex.Name == textureName)
|
if (tex.Name == textureName)
|
||||||
tex.Name = properName;
|
tex.Name = properName;
|
||||||
}
|
}
|
||||||
@ -120,6 +127,11 @@ namespace Toolbox.Library
|
|||||||
GC.Collect();
|
GC.Collect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
failedTextureExport.Add(Textures[i].Text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<Material> materials = new List<Material>();
|
List<Material> materials = new List<Material>();
|
||||||
foreach (var mat in Materials)
|
foreach (var mat in Materials)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user