MD3 sometimes uses relative paths to resolve shaders. It's also possible that other formats reference textures with relative paths.
The MemoryIOSystem does not fully support them. It's not possible to use .. to reference the parent directory.
There are 3 options to solve this:
A simple workaround by adjusting the name of a buffer when passing it to the ioSystem eg. "somePath/../../../scripts/object.shader" as the name for the buffer. This works for now but I don't think it's a permanent solution.
modify the ioSystem so that it can handle paths with ".." in them.
Move from using String to java.nio.file.Path to qualify the buffers in MemoryIOSystem. This way resolving paths would be trivial but it would require a full implementation of Path, FileSystem and FileSystemProvider. This is a lot of effort and I'm not sure it's worth it.
I think option 2 is the best on. It should work in all cases. Option 3 is overkill as the user should not interact with the ioSystem themself.
MD3 sometimes uses relative paths to resolve shaders. It's also possible that other formats reference textures with relative paths. The
MemoryIOSystem
does not fully support them. It's not possible to use..
to reference the parent directory. There are 3 options to solve this:String
tojava.nio.file.Path
to qualify the buffers inMemoryIOSystem
. This way resolving paths would be trivial but it would require a full implementation ofPath
,FileSystem
andFileSystemProvider
. This is a lot of effort and I'm not sure it's worth it.I think option 2 is the best on. It should work in all cases. Option 3 is overkill as the user should not interact with the ioSystem themself.