| 99 | } |
| 100 | |
| 101 | inline int NumFilesExist(const FString BaseFilePath, const bool ComplexMesh) |
| 102 | { |
| 103 | |
| 104 | if (FPaths::FileExists(BaseFilePath)) |
| 105 | return 1; |
| 106 | |
| 107 | if (ComplexMesh) |
| 108 | { |
| 109 | |
| 110 | FString BaseFileName = FPaths::GetBaseFilename(BaseFilePath); |
| 111 | FString WildcardPattern = FString::Printf(TEXT("%s_sub_*.obj"), *BaseFileName); |
| 112 | FString Directory = FPaths::GetPath(BaseFilePath); |
| 113 | |
| 114 | TArray<FString> FoundFiles; |
| 115 | IFileManager::Get().FindFiles(FoundFiles, *Directory, *WildcardPattern); |
| 116 | |
| 117 | int32 SubMeshCount = FoundFiles.Num(); |
| 118 | return SubMeshCount; |
| 119 | } |
| 120 | |
| 121 | // files not found |
| 122 | return 0; |
| 123 | } |
| 124 | |
| 125 | } // namespace IO |