mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-25 05:40:21 -04:00
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:
parent
8704feb079
commit
5e3fe1775f
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user