Don't be tricksy if we're already done.
The FBX SDK looks for our textures and often finds them. It helpfully tells us exactly where they are. Let's not throw that information away and demand that the textures only exist in precisely the folders we are aware of.
This commit is contained in:
parent
e992aac1d9
commit
3f1590a26b
|
@ -1323,6 +1323,9 @@ static void ReadAnimations(RawModel &raw, FbxScene *pScene)
|
|||
|
||||
static std::string GetInferredFileName(const std::string &fbxFileName, const std::string &directory, const std::vector<std::string> &directoryFileList)
|
||||
{
|
||||
if (FileUtils::FileExists(fbxFileName)) {
|
||||
return fbxFileName;
|
||||
}
|
||||
// Get the file name with file extension.
|
||||
const std::string fileName = StringUtils::GetFileNameString(StringUtils::GetCleanPathString(fbxFileName));
|
||||
|
||||
|
|
|
@ -55,6 +55,12 @@ namespace FileUtils {
|
|||
return std::string(cwd);
|
||||
}
|
||||
|
||||
bool FileExists(const std::string &filePath)
|
||||
{
|
||||
std::ifstream stream(filePath);
|
||||
return stream.good();
|
||||
}
|
||||
|
||||
bool FolderExists(const std::string &folderPath)
|
||||
{
|
||||
#if defined( __unix__ ) || defined( __APPLE__ )
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
namespace FileUtils {
|
||||
std::string GetCurrentFolder();
|
||||
|
||||
bool FileExists(const std::string &folderPath);
|
||||
bool FolderExists(const std::string &folderPath);
|
||||
|
||||
bool MatchExtension(const char *fileExtension, const char *matchExtensions);
|
||||
|
|
Loading…
Reference in New Issue