fix GetShortFilename function

when blender export fbx then embedded texture path have slash and back slash.
so GetShortFilename have to check both types of slashes
pull/5728/head
imdongye 2024-08-23 10:19:04 +09:00 committed by GitHub
parent bb9db8409f
commit 002b219ccd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -401,8 +401,9 @@ struct ASSIMP_API aiScene {
//! Returns a short filename from a full path
static const char* GetShortFilename(const char* filename) {
const char* lastSlash = strrchr(filename, '/');
if (lastSlash == nullptr) {
lastSlash = strrchr(filename, '\\');
const char* lastBackSlash = strrchr(filename, '\\');
if (lastSlash < lastBackSlash) {
lastSlash = lastBackSlash;
}
const char* shortFilename = lastSlash != nullptr ? lastSlash + 1 : filename;
return shortFilename;