question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Decoding gltf file run-time errors in Windows 10

See original GitHub issue

Problem

It fails to decode the assets/models/new/130/scene.gltf and terminate the program due to runtime error.

I have tried a fresh install on both win10 and linux twice, and it works seamlessly with the latter, so I assumed the errors is caused by win10 with the encoding of this specific gltf file.

This error happens occasionally, sometimes the program will be able to finish the whole/half episode.

Is there anyway to load this file in utf-8 or binary mode?

My environment setup

OS: Windows 10 Python version: 3.7 (via Anaconda)

Step to reproduce

python -m pgdrive.examples.enjoy_expert

Error messages

First error

Traceback (most recent call last):
  File "<PATH>.conda\envs\rl_dev\lib\site-packages\gltf\converter.py", line 1819, in load_model
    convert(file_path, bamfilepath, gltf_settings)
  File "<PATH>.conda\envs\rl_dev\lib\site-packages\gltf\converter.py", line 1796, in convert
    gltf_data = json.load(gltf_file)
  File "<PATH>.conda\envs\rl_dev\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
UnicodeDecodeError: 'cp950' codec can't decode byte 0x8d in position 49100: illegal multibyte sequence

Second error (caused by the first error)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<PATH>\.conda\envs\rl_dev\lib\site-packages\gltf\loader.py", line 21, in load_file
    options=options
  File "<PATH>\.conda\envs\rl_dev\lib\site-packages\gltf\converter.py", line 1825, in load_model
    raise RuntimeError("Failed to convert glTF file")
RuntimeError: Failed to convert glTF file
:loader(error): Loading scene.gltf failed with RuntimeError exception.
:loader(error): Couldn't load file pgdrive/assets/models/new/130/scene.gltf: invalid.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gamecraftCZcommented, Feb 21, 2021

You can change Windows encoding to UTF8 systemwide. This works for me. 😉 image

0reactions
pengzhenghaocommented, Feb 26, 2021
  • Maybe panda3d may have support for setting fixed encoding. But I never worked with with it so I don’t know.
  • If not, we can as a workaround have the files also have in encoding for windows and load them if windows is detected. But I don’t like this option.

Great! Thanks for you suggestions! Close this issue temporarily.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Windows Runtime Error in Windows 10? | Stellar
Steps to Fix Windows Runtime Error in Windows 10. Try quick fixes like update graphic driver, clean boot & system file checker to...
Read more >
T187844 Support the glTF 2.0 3D file format
Peeking at the spec, the problem is going to be with external files for textures and binary data -- JSON glTF files can...
Read more >
glTF™ 2.0 Specification - Khronos Registry
The plain text glTF JSON file description is compact and rapid to parse. All large data such as geometry, textures and animations are...
Read more >
ArcGIS Procedural Runtime Encoder/Decoder Reference
This is the PRT reference documentation for all built-in encoders and decoders. The encoder documentation lists for each encoder its supported ...
Read more >
3D for the Modern Web: Declarative 3D and glTF
Origin and Goals of glTF. Likewise Khronos has identified a related gap in the ecosystem - today there is no standard file type...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found