@@ -388,20 +388,20 @@ void ofxAssimpModelLoader::loadGLResources(){
388388 auto ogPath = texPathStr;
389389 bool bHasEmbeddedTexture = false ;
390390
391- string modelFolder = ofFilePath::getEnclosingDirectory ( file.path () );
392- string relTexPath = ofFilePath::getEnclosingDirectory (texPathStr,false );
393- string texFile = ofFilePath::getFileName ( texPathStr) ;
394- string realPath = ofFilePath::join ( ofFilePath::join (modelFolder, relTexPath), texFile);
391+ auto modelFolder = ofFilePath::getEnclosingDirectory ( file.path () );
392+ auto relTexPath = ofFilePath::getEnclosingDirectory (texPathStr,false );
393+ auto realPath = modelFolder / of::filesystem::path{ texPathStr } ;
394+
395395
396396#ifndef TARGET_LINUX_ARM
397397 if (bTryEmbed || ofFile::doesFileExist (realPath) == false ) {
398398 auto embeddedTexture = scene->GetEmbeddedTexture (ogPath.c_str ());
399399 if ( embeddedTexture ){
400400 bHasEmbeddedTexture = true ;
401- ofLogVerbose (" ofxAssimpModelLoader" ) << " loadGLResource() texture " << texFile << " is embedded " ;
401+ ofLogVerbose (" ofxAssimpModelLoader" ) << " loadGLResource() texture " << realPath. filename () << " is embedded " ;
402402 }else {
403403 ofLogError (" ofxAssimpModelLoader" ) << " loadGLResource(): texture doesn't exist: \" "
404- << file.getFileName () + " \" in \" " << realPath << " \" " ;
404+ << file.getFileName () + " \" in \" " << realPath. string () << " \" " ;
405405 }
406406 }
407407#endif
@@ -419,7 +419,7 @@ void ofxAssimpModelLoader::loadGLResources(){
419419 meshHelper.addTexture (assimpTexture);
420420
421421 ofLogVerbose (" ofxAssimpModelLoader" ) << " loadGLResource(): texture already loaded: \" "
422- << file.getFileName () + " \" from \" " << realPath << " \" " << " adding texture as " << assimpTexture.getTextureTypeAsString () ;
422+ << file.getFileName () + " \" from \" " << realPath. string () << " \" " << " adding texture as " << assimpTexture.getTextureTypeAsString () ;
423423 } else {
424424
425425 shared_ptr<ofTexture> texture = std::make_shared<ofTexture>();
@@ -463,7 +463,7 @@ void ofxAssimpModelLoader::loadGLResources(){
463463 ofLogVerbose (" ofxAssimpModelLoader" ) << " loadGLResource(): texture " << tmpTex.getTextureTypeAsString () << " loaded, dimensions: " << texture->getWidth () << " x" << texture->getHeight ();
464464 }else {
465465 ofLogError (" ofxAssimpModelLoader" ) << " loadGLResource(): couldn't load texture: \" "
466- << file.getFileName () + " \" from \" " << realPath << " \" " ;
466+ << file.getFileName () + " \" from \" " << realPath. string () << " \" " ;
467467 }
468468 }
469469 }
0 commit comments