diff --git a/Assets/VRM/Editor/Format/vrmAssetPostprocessor.cs b/Assets/VRM/Editor/Format/vrmAssetPostprocessor.cs index 264bf69a6..bdafda9d5 100644 --- a/Assets/VRM/Editor/Format/vrmAssetPostprocessor.cs +++ b/Assets/VRM/Editor/Format/vrmAssetPostprocessor.cs @@ -25,7 +25,14 @@ namespace VRM var ext = Path.GetExtension(path).ToLower(); if (ext == ".vrm") { - ImportVrm(UnityPath.FromUnityPath(path)); + try + { + ImportVrm(UnityPath.FromUnityPath(path)); + } + catch (VRMImporterContext.NotVrm0Exception) + { + // is not vrm0 + } } } } diff --git a/Assets/VRM/Runtime/IO/VRMImporterContext.cs b/Assets/VRM/Runtime/IO/VRMImporterContext.cs index 15af9f0b8..3f6c7d63d 100644 --- a/Assets/VRM/Runtime/IO/VRMImporterContext.cs +++ b/Assets/VRM/Runtime/IO/VRMImporterContext.cs @@ -10,6 +10,12 @@ namespace VRM { public class VRMImporterContext : ImporterContext { + public class NotVrm0Exception : Exception + { + public NotVrm0Exception() + { } + } + public VRM.glTF_VRM_extensions VRM { get; private set; } public VRMImporterContext(GltfParser parser, @@ -25,7 +31,7 @@ namespace VRM } else { - throw new KeyNotFoundException("not vrm0"); + throw new NotVrm0Exception(); } }