I use a FileLocator to load from a directory. However, I allow the user to change the name of the directory at runtime (I rename the folder). On the next call to assetManager.loadWhatever()
(yes, loading whicever type crashes the app), I get this:
Exception in thread "Thread-7" java.lang.IllegalArgumentException: Given root path "D:\JME3 Projects\LSF Blueprint Builder\ships\A pod" is not a directory
at com.jme3.asset.plugins.FileLocator.setRootPath(FileLocator.java:54)
at com.jme3.asset.ImplHandler$ImplThreadLocal.initialValue(ImplHandler.java:119)
at java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:180)
at java.lang.ThreadLocal.get(ThreadLocal.java:170)
at com.jme3.asset.ImplHandler.tryLocate(ImplHandler.java:177)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:359)
at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:390)
at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:400)
at com.grizeldi.lsfmobile.appstates.MainMenuAppState$1.run(MainMenuAppState.java:99)
at java.lang.Thread.run(Thread.java:745)
In this case the old directory name was “A Pod” and new one was “Bloxxel”.
I think the problem here is that assetManager tries to look into the folder which has in the meantime disappeared. So how would I remove a FileLocator?
EDIT: Ignore this, I’m stupid . For future people, there is
assetManager.unregisterLocator()
. <— this sadly doesn’t work
EDIT2: Unregistering the locator did not fix it though. Seeking help still.