JamesTKhan/Mundus

Error during import model what's name contains space

Closed this issue · 11 comments

Dgzt commented

Describe the bug
Mundus editor don't find the texture if it's name contains space.

To Reproduce
Steps to reproduce the behavior:

  1. Create a texture for a model in Blender what's name contains space.
  2. Go to Mundus editor
  3. Click on 'Import/Import 3D model' button
  4. Select the model
  5. Click to 'IMPORT' button.
  6. See error

Screenshots
blender
mundus_editor

Dgzt commented

Should we change all "%20" text to " " in file name?

I don't think we can do anything to fix this from the Mundus side. The error appears to come from within gdx-gltf GLTFLoader process. I replicated the same issue on a non-Mundus project using gdx-gltf.

Dgzt commented

I've opened an issue on gdx-gltf project: mgsx-dev/gdx-gltf#81

Dgzt commented

mgsx-dev fixed this issue in gdx-gltf project. Should we wait for the next gdx-gltf release or use master-SNAPSHOT version?

After chat with MGSX is discord they intend to release a new gdx-gltf version soon. Once that is released we can update to that, or we could point to a specific commit id now. I would rather not point to master-SNAPSHOT as that is changing often and we want to have consistent versioning and control when we update the library on the Mundus side.

If the release is not out by end of next week we could move forward with an upgrade to point to a specific commit id so will follow up next week on this.

Dgzt commented

I tried with 2.1.0 version of gdx-gltf. This version doesn't solve this issue because we doesn't use SeparatedDataFileResolver file (source: mgsx-dev/gdx-gltf@7b6253d). I think we should copy this decodePath(String) method to FileHandleWithDependencies and use it like:

dto.images?.forEach {
            val depFile = FileHandle(file.parent().path() + '/' + decodePath(it.uri))
            if (depFile.exists()) {
                images.add(depFile)
                dependencies.add(depFile)
            }
        }

I will take another look, but when I replicated this the other day, the stack trace pointed to SeparatedDataFileResolver. Either way when we do the upgrade I will need do compare 2.1.0 GLSL shader code with Mundus and manually merge them as Mundus is using a modified version of shaders

Looks like it could be a two part issue. On import even the file with spaces in the name is not copied over into the temp directory which is then given to GLTFLoader. So yes we may need to do decoding on our end too.

Yes your suggestion above appears to resolve the issue on the Mundus side + 2.1.0 resolves it on gdx-gltf side. Do you want to implement it or should I go ahead?

Dgzt commented

I reverted the changes on my environment, if you have this changes on your environment pls go head.

PR opened