AssetManager FileLocator

Hello,



I totally understand your intention regarding AssetManager. You have got a library, let’s say a file structure containing sub directories. You register a FileLocator which has got a parent directory as a parameter. Relative from this parent directory you can load any asset. My problem is following. I want to have a more “general” way as an alternative. Let’s say that I have got a texture in my tree. Everything is displayed correctly. I want to change the image of the texture. The image could be anywhere. So, I could, of course, get the absolute file path of the image, take its parent using



[java]

file.getParent().toString

[/java]



and register a FileLocator. However, imagine I would like to load 10 images from 10 totally different locations. I would have to register 10 FileLocators. This would only produce mess. Is there a way to load an asset from anywhere, something like an “use once” solution.

Thanks.



Regards

Normen created a tool in JMP to import j3o files from a drive directory.

It copies files int the asset folder.

You could have a similar approach, just make the user choose an image, copy it in the asset folder, and then load the image from the asset folder.

10 FileLocators not only produce mess, they also inhibit each other from loading textures and files with the same name. I elaborate a bit more in the “Import Models” section of the jMonkeyPlatform manual.

Hello,



OK. Then, how can I deregister a locator? Setting null to the same rootPath I used to register a locator?



Thanks.



Uppps. Sorry found unregisterLocator recently :slight_smile: