Unity-Technologies / ProjectAuditor

Project Auditor is an experimental static analysis tool for Unity Projects.
Other
815 stars 67 forks source link

Meshmodule and analyzer fixes #151

Closed borisbauer-unity closed 1 year ago

borisbauer-unity commented 1 year ago

This change contains two corrections to the Mesh Module / Analyzers:

  1. Pure mesh assets (not Models): The code covers an asset type that just contains one mesh and doesn't use the ModelImporter. Typically file type ".mesh" or ".asset" where the user created or duplicated a single mesh.

Details: This could be a procedural mesh written to a file or a duplicated subasset mesh (duplication as a Editor user action implicitly creates a file with extension ".mesh" to store a single mesh in). Those mesh assets don't use the ModelImporter, thus there is no compression to report or other available advanced mesh asset import settings.

  1. Now subassets are being iterated over so we analyze all subasset meshes within e.g. an imported .fbx.
borisbauer-unity commented 1 year ago

Could there be a case where a mesh belongs to multiple assets where we will end up generating duplicate diagnostics for the same mesh?

Interesting question.

I can ask on our channels if that is a thing, if it is possible for multiple assets to refer to the same subasset (which sounds like that subasset would need to be contained in a separate unique mesh asset we refer to via a GUID internally).