diff --git a/MeshCompression/Editor/MeshCompressionPlugin.cs b/MeshCompression/Editor/MeshCompressionPlugin.cs index 48e2cc6..2d3c44d 100644 --- a/MeshCompression/Editor/MeshCompressionPlugin.cs +++ b/MeshCompression/Editor/MeshCompressionPlugin.cs @@ -51,16 +51,21 @@ namespace gay.lilyy.MeshCompression if (mesh == null) continue; + var localConfig = renderer.GetComponent(); + var effectiveConfig = localConfig != null ? localConfig : defaultConfig; + if (effectiveConfig == null) continue; + + var path = AssetDatabase.GetAssetPath(mesh); if (string.IsNullOrEmpty(path) || !path.EndsWith(".fbx", System.StringComparison.OrdinalIgnoreCase)) + { + if (localConfig != null) Debug.LogError($"[NDMF] Could not find FBX for {renderer.gameObject.name}"); continue; + } var importer = AssetImporter.GetAtPath(path) as ModelImporter; if (importer == null) continue; - var localConfig = renderer.GetComponent(); - var effectiveConfig = localConfig != null ? localConfig : defaultConfig; - if (effectiveConfig == null) continue; var targetCompression = GetTargetCompression(effectiveConfig); var unityCompression = GetCompression(targetCompression);