UTF-8 Encoding Error?

Issue #1973 closed
Donald Dade created an issue

I swear I’ve seen this before, something about this 0xb0 start byte error.

Blender 4.0, Diffeomorphic-import_daz-a1bc0d5d4bfd.zip

Getting the following error with assets from Medieval Castle Construction Kit, any ideas?

Preprocessing...
Fitting objects with dbz file...
Traceback (most recent call last):
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\error.py", line 223, in execute
self.run(context)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\main.py", line 287, in run
self.loadDazFile(filepath, context)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\main.py", line 145, in loadDazFile
fitToFile(filepath, main.nodes)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\dbzfile.py", line 279, in fitToFile
dbz = loadDbzFile(filepath)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\dbzfile.py", line 148, in loadDbzFile
struct = loadJson(filepath)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\load_json.py", line 116, in loadJson
string = bytes.decode("utf-8-sig")
File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\python\lib\encodings\utf_8_sig.py", line 23, in decode
(output, consumed) = codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 132091211: invalid start byte
Error: Python: Traceback (most recent call last):
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\error.py", line 223, in execute
self.run(context)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\main.py", line 287, in run
self.loadDazFile(filepath, context)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\main.py", line 145, in loadDazFile
fitToFile(filepath, main.nodes)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\dbzfile.py", line 279, in fitToFile
dbz = loadDbzFile(filepath)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\dbzfile.py", line 148, in loadDbzFile
struct = loadJson(filepath)
FilTraceback (most recent call last):
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\error.py", line 223, in execute
self.run(context)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\main.py", line 762, in run
self.easyImport(context)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\main.py", line 771, in easyImport
bpy.ops.daz.import_daz_manually(
File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\modules\bpy\ops.py", line 109, in call
ret = _op_call(self.idname_py(), kw)
RuntimeError: Error: Python: Traceback (most recent call last):
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\error.py", line 223, in execute
self.run(context)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\main.py", line 287, in run
self.loadDazFile(filepath, context)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\main.py", line 145, in loadDazFile
fitToFile(filepath, main.nodes)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\dbzfile.py", line 279, in fitToFile
dbz = loadDbzFile(filepath)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\dbzfile.py", line 148, in loadDbzFile
struct = loadJson(filepath)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Diffeomorphic-import_daz-a1bc0d5d4bfd\load_json.py", line 116, in loadJson
string = bytes.decode("utf-8-sig")
File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\python\lib\encodings\utf_8_sig.py", line 23, in decode
(output, consumed) = codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 132091211: invalid start byte
Location: C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\modules\bpy\ops.py:109

Comments (8)

  1. Thomas Larsson repo owner

    Is this something that only happens for this asset, or does it happen regularly? If it is unique for this asset, it may be because it is too big for the export script to handle. Have you considered importing the file with mesh fitting set to one of the unmorphed option, when the dbz file isn’t needed?

    Something seems to be wrong with the dbz file at the 132091211:th byte, so I presume that the size of the dbz file is at least 132 Mb. The dbz export script uses the daz api. We have previously had problems to export hd dbz files above five subdivisions or so, because something became too big for DS to handle. In that case the dbz file could still be loaded but it didn't contain the expected info.

  2. Donald Dade reporter

    Hi Thomas,

    First, your workaround worked like a charm. I really need to learn your tool better.

    Maybe you’d prefer to close this issue because the dbz is not necessary for an environment, but if not:

    No, it happens with just with this asset. But the dbz file was just 27M, and the largest file in its directory under /data was less than 8M. If you’d like to pursue it, just let me know what info you need.

    Thanks!

  3. Donald Dade reporter

    Oh, I noticed just now that 27M is the compressed length. The uncompressed length is 136107912, so you are right. So, the workaround is to just import with unmorphed mesh fitting when importing an environment?

  4. Thomas Larsson repo owner

    What is best depends on the scene. If it doesn’t contain any morphs it should be safe to use unmorphed. If morphs are important you could also try the morphed option. That should work if the morphs don’t have to be transferred to clothes. Dbz apparently has issues with very large scenes.

    Of the two unmorphed options, shared reuses the same mesh if it is used in several places, whereas unique creates a unique mesh for each instance. Use shared to reduce size e.g. for many leaves which use the same mesh, and use shared if you have several paintings with the same mesh but different materials.

  5. Donald Dade reporter

    Thank you for the advice. I suppose this issue can be closed, and as usual, thank you for this tool.

  6. Log in to comment