UnicodeDecodeError while import MHX2 file

Discussions about MHX2 and other plugins that are developed outside the scope of MakeHuman. Note that bug reports should go to the respective code projects and might go unseen here.

Moderator: joepal

UnicodeDecodeError while import MHX2 file

Postby spkingr » Tue Jun 23, 2020 1:35 am

I installed the plugins for Makehuman 1.20 and Blender 2.83, but it did not work, the error in Blender:

Code: Select all
Traceback (most recent call last):
  File "C:\Users\Qingwen Liu\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\import_runtime_mhx2\importer.py", line 57, in execute
    importMhx2File(self.filepath, cfg, context)
  File "C:\Users\Qingwen Liu\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\import_runtime_mhx2\importer.py", line 144, in importMhx2File
    struct, time1 = importMhx2Json(filepath)
  File "C:\Users\Qingwen Liu\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\import_runtime_mhx2\importer.py", line 159, in importMhx2Json
    struct = loadJson(filepath)
  File "C:\Users\Qingwen Liu\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\import_runtime_mhx2\load_json.py", line 39, in loadJson
    struct = json.load(fp)
  File "D:\Software\Blender\2.83\python\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 3074663: illegal multibyte sequence

location: <unknown location>:-1

Help and thanks! :geek:
Posts: 5
Joined: Mon Jun 22, 2020 8:28 am

Re: UnicodeDecodeError while import MHX2 file

Postby joepal » Thu Jun 25, 2020 10:29 am

It seems either the mhx file you tried to import, or possibly one of the textures it links to contained an illegal character in its file name.

Which file or what character cannot be seen here. But my guess is that the encoding "gbk" has characters which are not representable in UTF-8. Try renaming files which look suspicious so they only have english characters in their names. Also make sure the files arent in a directory with illegal characters in its name.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
Posts: 3765
Joined: Wed Jun 04, 2008 11:20 am

Re: UnicodeDecodeError while import MHX2 file

Postby MTKnife » Mon Jun 29, 2020 4:26 am

GBK is apparently a fairly common encoding for simplified Chinese characters, but it includes stuff that's not in Unicode: https://en.wikipedia.org/wiki/GBK_(character_encoding)

Note that anything in Unicode--which should include most anything in any Latin script, plus a lot of other stuff--should be work, not just English names.
Posts: 280
Joined: Tue Sep 01, 2015 5:22 am

Return to MHX2 and other plugins developed outside MakeHuman

Who is online

Users browsing this forum: No registered users and 1 guest