Added so when the exported animator contains MeshRenderers without meshes attached it tries to find the missing meshes by the Renderer's original name. (Fixes NagantSR0101 from Girls Frontline 2 Animator export not exporting meshes at all in any existing variant.) Also set ReShade in 3D view to be disabled by default as it is misleading otherwise

This commit is contained in:
hungrydoodles 2024-05-14 23:58:13 +05:00
parent 8704feb079
commit 5e3fe1775f
2 changed files with 25 additions and 1 deletions

View File

@ -2714,7 +2714,7 @@ namespace AssetStudioGUI
GL.GenVertexArrays(1, out vao); GL.GenVertexArrays(1, out vao);
GL.BindVertexArray(vao); GL.BindVertexArray(vao);
CreateVBO(out var vboPositions, vertexData, attributeVertexPosition); CreateVBO(out var vboPositions, vertexData, attributeVertexPosition);
if (normalMode == 0) if (normalMode == 1)
{ {
CreateVBO(out var vboNormals, normal2Data, attributeNormalDirection); CreateVBO(out var vboNormals, normal2Data, attributeNormalDirection);
} }

View File

@ -589,6 +589,30 @@ namespace AssetStudio
} }
} }
// Last resort
#if DEBUG
Console.WriteLine($"Mesh Renderer had no mesh attached during export, resorting to dumb name search among assets");
#endif
GameObject go;
if (meshR.m_GameObject.TryGet(out go))
{
string meshR_originalName = go.m_Name;
foreach (var serializedFile in go.assetsFile.assetsManager.assetsFileList)
{
//var nameRelatedMesh = serializedFile.Objects.FirstOrDefault(o => (o is Mesh) && (o as NamedObject).m_Name == meshR_originalName, null);
// It's not possible to hot-reload lambdas with captures.
// I'm not gonna reload 50 GB worth of assets in RAM in debug again for the code to look fancy.
foreach (var o in serializedFile.Objects)
if (o is Mesh && (o as Mesh).m_Name == meshR_originalName)
{
#if DEBUG
Console.WriteLine($"Found a replacement Mesh succesfully for the component {meshR_originalName} which has no mesh attached");
#endif
return o as Mesh;
}
}
}
return null; return null;
} }