aelurum / AssetStudio

AssetStudioMod - modified version of Perfare's AssetStudio, mainly focused on UI optimization and some functionality enhancements.
MIT License
520 stars 41 forks source link

Mesh lookup if Renderer is missing a mesh reference during Animator export #40

Closed HungryDoodles closed 3 weeks ago

HungryDoodles commented 6 months ago

Some Animators may be used as templates for use with skin variants, hence their m_Mesh may be null in the hierarchy as those are set at runtime. This becomes a problem, for example, when exporting GameObjects or Animators with such templates (as for example NagantSR0101 among GirlsFrontline 2 assets in any of its variants will export no meshes). Looks like those components still contain the name of the mesh they come with, so the app will now try to use that name to look up the missing mesh in the entirety of loaded assets. This enables: 1) Export in fbx as Animators are exported in fbx by default. 2) Skeleton and skinning weights are exported (unlike .obj). 3) Makes use of the structure available and visible regardless of m_Mesh being null or not. It may not be guaranteed, of course, depends on the game assets.