Jump to content

mountPoint doesn't load assets


photo

Recommended Posts

Posted (edited)

Hello,

I'm using a mount point in my project. I'm creating it dynamically in runtime using the functions addBlobFile and createMount but it doesn't load new materials (Unigine::Materials::getNumMaterials() returns the same number before and after createMount() ), although it doesn't return NULL.
How can I make this mountpoint work so I can dynamically add in my project an external folder ?
I also tried to create a .umount file for the mount point with the exact same path but I have the error FontTTF::FontTTF(): can't open "mountPointName/core/gui/console.ttf" file

Thanks in advance

Edited by Pierre_Bultingaire
Posted

Hi again,

Unigine will refresh everything during the engine loop. If you use getNumMaterials() right after mounting, e.g. in the same method, the engine will not have refreshed yet.
You can trigger it manually if necessary:
 

// Try to ensure files are mounted after calling this method.
if (Unigine::Engine::isInitialized() && Unigine::Engine::get()->isWorldLoaded()) {
    Unigine::Engine::get()->update();
}

This might lead to undesired side effects though.

Best regards

×
×
  • Create New...