MCPcopy Create free account
hub / github.com/URLab-Sim/UnrealRoboticsLab / NumFilesExist

Function NumFilesExist

Source/URLab/Public/Utils/IO.h:101–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101inline 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

Callers 1

PrepareMeshForMuJoCoMethod · 0.85

Calls 1

GetPathFunction · 0.50

Tested by 1

PrepareMeshForMuJoCoMethod · 0.68