Maniphest T73225

import .obj error
Closed, Duplicate

Assigned To
Robert Guetzkow (rjg)
Authored By
Marcos Souza (marcossou)
Jan 18 2020, 11:06 PM
Tags
  • Add-ons (Community)
Subscribers
Amir Mehr (Amir_Mehr)
Marcos Souza (marcossou)
Robert Guetzkow (rjg)

Description

System Information
Operating system: windows 10
Graphics card: intel

Blender Version
Broken: 2.81
(example: 2.79b release)
(example: 2.80, edbf15d3c044, blender2.8, 2018-11-28, as found on the splash screen)
Worked: (optional)

Short description of error

when I import a file .obj ( File -> import -> wavefront (.obj) apeears the message:

bpy.data.window_managers["WinMan"].addon_search = "obj"
bpy.context.space_data.recent_folders_active = 0
Traceback (most recent call last):

File "C:\Program Files\Blender Foundation\Blender 2.81\2.81\scripts\addons\io_scene_obj\__init__.py", line 145, in execute
  return import_obj.load(context, **keywords)
File "C:\Program Files\Blender Foundation\Blender 2.81\2.81\scripts\addons\io_scene_obj\import_obj.py", line 1232, in load
  use_image_search, float_func)
File "C:\Program Files\Blender Foundation\Blender 2.81\2.81\scripts\addons\io_scene_obj\import_obj.py", line 419, in create_materials
  context_material_name, img_data, line, 'Ka')
File "C:\Program Files\Blender Foundation\Blender 2.81\2.81\scripts\addons\io_scene_obj\import_obj.py", line 161, in load_material_image
  image = obj_image_load(context_imagepath_map, line, DIR, use_image_search, relpath)
File "C:\Program Files\Blender Foundation\Blender 2.81\2.81\scripts\addons\io_scene_obj\import_obj.py", line 108, in obj_image_load
  imagepath = os.fsdecode(b" ".join(filepath_parts[i:]))
File "C:\Program Files\Blender Foundation\Blender 2.81\2.81\python\lib\os.py", line 823, in fsdecode
  return filename.decode(encoding, errors)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf2 in position 2: invalid continuation byte

location: <unknown location>:-1

Exact steps for others to reproduce the error
Based on the default startup or an attached .blend file (as simple as possible).

Event Timeline

Marcos Souza (marcossou) created this task.Jan 18 2020, 11:06 PM
Robert Guetzkow (rjg) closed this task as Archived.Jan 18 2020, 11:20 PM
Robert Guetzkow (rjg) claimed this task.
Robert Guetzkow (rjg) added a subscriber: Robert Guetzkow (rjg).

It seems that your .obj/.mtl files aren't UTF-8 encoded and therefore decoding the image path fails. This is not a bug in Blender since all files are expected to have UTF-8 encoding. Please try to convert the encoding.

For further assistance please post a question on Blender's StackExchange, blenderartists.org or the Blender support channel.

Amir Mehr (Amir_Mehr) added a subscriber: Amir Mehr (Amir_Mehr).Jan 30 2021, 9:18 AM

Thanks, I changed .mtl file unicode to UTF8 and it's worked. I did it with Notepad++, Encoding>Convert to UTF8