Problem while import/export of obj files #47053

Closed
opened 2015-12-23 19:22:03 +01:00 by Sumanth Alwala · 7 comments

System Information
Windows 10 - 64 bit

Intel HD Graphics 5500 (No other dedicated graphics card available)
XPS 13" - 9343
Intel i5 processor

8 gb ram

Blender Version
blender-2.76-ee2b583-win64.zip
Downloaded from the link https://builder.blender.org/download/

Short description of error
I am trying to export an obj file which has material and texture. It gives me the following error: (the obj file gets half exported, in the sense, the object and material data is exported but not the texture data)

location: :-1

Traceback (most recent call last):

File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\__init__.py", line 306, in execute
  return export_obj.save(context, **keywords)
File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\export_obj.py", line 840, in save
  EXPORT_PATH_MODE=path_mode,
File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\export_obj.py", line 784, in _write
  progress,
File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\export_obj.py", line 705, in write_file
  write_mtl(scene, mtlfilepath, EXPORT_PATH_MODE, copy_set, mtl_dict)
File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\export_obj.py", line 187, in write_mtl
  if mtex.offset != Vector((0.0, 0.0, 0.0)):

NameError: name 'Vector' is not defined

I tried to import an obj file with material and texture data that was created on a different computer and then I am getting the following error:

location: :-1
Traceback (most recent call last):

File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\__init__.py", line 147, in execute
  return import_obj.load(context, **keywords)
File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\import_obj.py", line 1162, in load
  unique_material_images, use_image_search, float_func)
File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\import_obj.py", line 409, in create_materials
  load_material_image(context_material, context_material_name, img_data, 'Kd')
File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\import_obj.py", line 102, in load_material_image
  image = obj_image_load(imagepath, DIR, use_image_search, relpath)
File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\import_obj.py", line 67, in obj_image_load
  image = load_image(imagepath.replace(b'_', b' '), DIR, recursive=recursive, relpath=relpath)
File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\modules\bpy_extras\image_utils.py", line 187, in load_image
  nfilepath = next(_recursive_search(search_paths, image_filter), None)
File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\modules\bpy_extras\image_utils.py", line 132, in _recursive_search
  for dirpath, dirnames, filenames in os.walk(path):
File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\python\lib\os.py", line 366, in walk
  scandir_it = scandir(top)

TypeError: os.scandir() doesn't support bytes path on Windows, use Unicode instead

There are no errors when trying to import an obj file without any texture or material data though.
Exact steps for others to reproduce the error
Based on a (as simple as possible) attached .blend file with minimum amount of steps

**System Information** Windows 10 - 64 bit ``` Intel HD Graphics 5500 (No other dedicated graphics card available) XPS 13" - 9343 Intel i5 processor ``` 8 gb ram **Blender Version** blender-2.76-ee2b583-win64.zip Downloaded from the link https://builder.blender.org/download/ **Short description of error** I am trying to export an obj file which has material and texture. It gives me the following error: (the obj file gets half exported, in the sense, the object and material data is exported but not the texture data) location: <unknown location>:-1 Traceback (most recent call last): ``` File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\__init__.py", line 306, in execute return export_obj.save(context, **keywords) File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\export_obj.py", line 840, in save EXPORT_PATH_MODE=path_mode, File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\export_obj.py", line 784, in _write progress, File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\export_obj.py", line 705, in write_file write_mtl(scene, mtlfilepath, EXPORT_PATH_MODE, copy_set, mtl_dict) File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\export_obj.py", line 187, in write_mtl if mtex.offset != Vector((0.0, 0.0, 0.0)): ``` NameError: name 'Vector' is not defined I tried to import an obj file with material and texture data that was created on a different computer and then I am getting the following error: location: <unknown location>:-1 Traceback (most recent call last): ``` File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\__init__.py", line 147, in execute return import_obj.load(context, **keywords) File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\import_obj.py", line 1162, in load unique_material_images, use_image_search, float_func) File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\import_obj.py", line 409, in create_materials load_material_image(context_material, context_material_name, img_data, 'Kd') File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\import_obj.py", line 102, in load_material_image image = obj_image_load(imagepath, DIR, use_image_search, relpath) File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\addons\io_scene_obj\import_obj.py", line 67, in obj_image_load image = load_image(imagepath.replace(b'_', b' '), DIR, recursive=recursive, relpath=relpath) File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\modules\bpy_extras\image_utils.py", line 187, in load_image nfilepath = next(_recursive_search(search_paths, image_filter), None) File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\scripts\modules\bpy_extras\image_utils.py", line 132, in _recursive_search for dirpath, dirnames, filenames in os.walk(path): File "C:\Users\Sumanth\Downloads\blender-2.76.0-git.ee2b583-AMD64\2.76\python\lib\os.py", line 366, in walk scandir_it = scandir(top) ``` TypeError: os.scandir() doesn't support bytes path on Windows, use Unicode instead There are no errors when trying to import an obj file without any texture or material data though. **Exact steps for others to reproduce the error** Based on a (as simple as possible) attached .blend file with minimum amount of steps
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @Sum.Al

Added subscriber: @Sum.Al

This issue was referenced by c0a273d1e7

This issue was referenced by c0a273d1e7ae86f635816896be762dad3ebd1662

Added subscriber: @mont29

Added subscriber: @mont29

Fixed the export bug. The import one is in fact a bug in Python3.5 and windows, we already have a report for it so will merge this one in.

Fixed the export bug. The import one is in fact a bug in Python3.5 and windows, we already have a report for it so will merge this one in.

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed as duplicate of #47018

Closed as duplicate of #47018
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#47053
No description provided.