Skip to content

read from memory relative paths #17

@Wasabi375

Description

@Wasabi375

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:

  1. 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.
  2. modify the ioSystem so that it can handle paths with ".." in them.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions