Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLB import incorrectly handles texture paths containing Unicode escape characters #476

Closed
hakanai opened this issue Jul 17, 2020 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@hakanai
Copy link

hakanai commented Jul 17, 2020

Describe the bug

While importing a GLB file, if texture names contained Unicode escapes such as "\u8868\u60c5", UniVRM appears to treat the "\" as if it's a path separator, attempts to write the texture to "u8868/u60c5.png" and then fails the import.

To Reproduce

e.g. Steps to reproduce the behavior:

  1. Have a GLB file where at least one of the textures contains at least two escaped Unicode characters.

    In the JSON, this should look something like this:

     {"bufferView":189,"mimeType":"image/png","name":"\u8868\u60c5"}
    
  2. Drag that GLB into the project and wait while UniVRM attempts to import it.

What happens:

  • You get an error in the console that it couldn't write the file. This happens because the parent directory does not exist. (If you manually create the directory it will then write the file, albeit with the wrong name.)
  • The import is aborted.

Expected behavior

The Unicode characters should have been escaped by the JSON parser before they even got to the import code. The files should be written to disk with the correct Unicode characters, instead of the escape sequence.

Screenshots

N/A

Environments (please complete the following information):

  • OS: macOS 10.15
  • Unity version: 2018.4.20
  • UniVRM version: 0.56.3_3b68
@hakanai
Copy link
Author

hakanai commented Jul 17, 2020

I should note that one way to reliably get a GLB file with character escapes in it is to have Japanese characters in your texture names and do the GLB export from Blender. Blender escapes the Japanese characters instead of leaving them as Unicode.

@hiroj hiroj added the bug Something isn't working label Jul 20, 2020
@ousttrue ousttrue added this to the v0.66 milestone Jan 29, 2021
@ousttrue
Copy link
Contributor

ousttrue commented Feb 2, 2021

UniGLTF serializer not implemented unicode escape.
like \u8868 .

This will reproduce.
Cube.glb.zip

ousttrue added a commit to ousttrue/UniVRM that referenced this issue Feb 2, 2021
@ousttrue
Copy link
Contributor

ousttrue commented Feb 2, 2021

v0.66.0

@ousttrue ousttrue closed this as completed Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants