Page MenuHome

Error when Importing OBJ | UnicodeDecodeError
Closed, ArchivedPublic

Description

System Information
Operating system: Microsoft Windows 10 Pro

Blender Version
Broken: (example: 2.80, edbf15d3c044, master, 2018-11-28, as found on the splash screen)
Worked: (optional)

We're getting an error when importing an OBJ. I think it's be cause some chines character in the model, but I'm sure you can shine some light on it.

python
Traceback (most recent call last):
  File "C:\Program Files (x86)\blender\2.80\scripts\addons\io_scene_obj\__init__.py", line 145, in execute
    return import_obj.load(context, **keywords)
  File "C:\Program Files (x86)\blender\2.80\scripts\addons\io_scene_obj\import_obj.py", line 1215, in load
    use_image_search, float_func)
  File "C:\Program Files (x86)\blender\2.80\scripts\addons\io_scene_obj\import_obj.py", line 407, in create_materials
    context_material_name, img_data, line, 'Ka')
  File "C:\Program Files (x86)\blender\2.80\scripts\addons\io_scene_obj\import_obj.py", line 139, in load_material_image
    image = obj_image_load(context_imagepath_map, line, DIR, use_image_search, relpath)
  File "C:\Program Files (x86)\blender\2.80\scripts\addons\io_scene_obj\import_obj.py", line 86, in obj_image_load
    imagepath = os.fsdecode(b" ".join(filepath_parts[i:]))
  File "C:\Program Files (x86)\blender\2.80\python\lib\os.py", line 823, in fsdecode
    return filename.decode(encoding, errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb1 in position 22: invalid start byte

location: <unknown location>:-1

I've attached the geometry that raises this issue.

If in fact the issue is caused with the characters in the path or something, do you have suggestion on how to fix it?

Appreciate your help in advance.
-Ali

Details

Type
Bug

Event Timeline

The issue is not in the .obj, but the accompaning .mtl which is not UTF-8 encoded. Re-Encode the .mtl to UTF-8 an it will open properly. Since .mtl is specified as ASCII format, this is not a bug in Blender. The .mtl simply doesn't follow the specification.

Robert Guetzkow (rjg) closed this task as Archived.Wed, Aug 14, 9:22 PM
Robert Guetzkow (rjg) claimed this task.

I'm closing this ticket since this is not a bug in Blender.

Also a duplicated of T67987. If you need further assistance to convert the file to the proper encoding or fix the map_* attributes in the file, please post a question on Blender's StackExchange.

Hello Robert,

Thanks for looking into it.

Since this ticket is public, would you mind removing the OBJ attachment from the ticket please?

Thanks

I don't have the required permission to delete the file and the edit history is public as well.