private void ImportGLTF(CreateObjectModel fileModel) { try { if (_importer != null) { _importer.cleanArtifacts(); _importer = null; } _importer = new SketchfabImporter(UpdateProgress, OnFinishImport); _importer.configure(GLTFUtils.getPathAbsoluteFromProject(fileModel.ModelFolder), Path.GetFileNameWithoutExtension(fileModel.Path), false); _importer.loadFromFile(fileModel.Path); fileModel.Extras = ParseAssetForLicense(_importer.GetGLTFInput()); } catch (Exception e) { EditorUtility.DisplayDialog("Error!", $"Problem when importing a model for \"{fileModel.ObjectName}\" ({fileModel.Path}):\nNot valid model structure ({e.Message})", "OK"); Debug.LogException(e); CleanUp(); fileModel.Skip = true; if (_gltfQueue.Contains(fileModel)) { _gltfQueue.Remove(fileModel); } if (Directory.Exists("Assets/Objects/" + fileModel.ObjectName)) { Directory.Delete("Assets/Objects/" + fileModel.ObjectName, true); } } }