[BUG] obj importer seems to be broken when trying to import files with texture patch that don;t exist. #47986

Closed
opened 2016-03-29 06:35:05 +02:00 by Martin Zapata · 6 comments

System Information
OSX 10.11.3 (El Capitan) Nvidia GTX 680m iMac Late 2012 Core i7 3.4Ghz, 32GB RRAM 1TB Fusion Drive

Blender Version
Broken: 2.77 22a2853
Worked: all versions prior to 2.77

Short description of error
Importing Obj files from another system that has absolute texture filename paths in it (e.g. C:\users\username\something.jpg) won't open in Blender. Get the following error since the path doesn't exist on OS X. In previous versions Blender would put in a default black texture and let me update th file paths via the editor. Now it refuses to import the files at all.

Traceback (most recent call last):

File "/Applications/blender.app/Contents/Resources/2.77/scripts/addons/io_scene_obj/__init__.py", line 147, in execute
  return import_obj.load(context, **keywords)
File "/Applications/blender.app/Contents/Resources/2.77/scripts/addons/io_scene_obj/import_obj.py", line 1165, in load
  unique_material_images, use_image_search, float_func)
File "/Applications/blender.app/Contents/Resources/2.77/scripts/addons/io_scene_obj/import_obj.py", line 401, in create_materials
  load_material_image(context_material, context_material_name, img_data, 'Ka')
File "/Applications/blender.app/Contents/Resources/2.77/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 "/Applications/blender.app/Contents/Resources/2.77/scripts/addons/io_scene_obj/import_obj.py", line 71, in obj_image_load
  return load_image(imagepath, DIR, recursive=recursive, place_holder=True, relpath=relpath)
File "/Applications/blender.app/Contents/MacOS/../Resources/2.77/scripts/modules/bpy_extras/image_utils.py", line 199, in load_image
  return _image_load_placeholder(imagepath)
File "/Applications/blender.app/Contents/MacOS/../Resources/2.77/scripts/modules/bpy_extras/image_utils.py", line 86, in _image_load_placeholder
  image = bpy.data.images.new(name, 128, 128)

TypeError: BlendDataImages.new(): error with argument 1, "name" - Function.name error assigning string, UnicodeEncodeError('utf-8' codec can't encode character '\udcc7' in position 0: surrogates not allowed)

location: :-1

Exact steps for others to reproduce the error

This only happens when importing .obj files.

Steps to reproduce.

1.Unzip file with .obj in it.
2.Go to File > Import > Wavefront(.obj)
3.navigate to where the files location
4. try to import object and you will get the error.

SheHulk.zip

**System Information** OSX 10.11.3 (El Capitan) Nvidia GTX 680m iMac Late 2012 Core i7 3.4Ghz, 32GB RRAM 1TB Fusion Drive **Blender Version** Broken: 2.77 22a2853 Worked: all versions prior to 2.77 **Short description of error** Importing Obj files from another system that has absolute texture filename paths in it (e.g. C:\users\username\something.jpg) won't open in Blender. Get the following error since the path doesn't exist on OS X. In previous versions Blender would put in a default black texture and let me update th file paths via the editor. Now it refuses to import the files at all. Traceback (most recent call last): ``` File "/Applications/blender.app/Contents/Resources/2.77/scripts/addons/io_scene_obj/__init__.py", line 147, in execute return import_obj.load(context, **keywords) File "/Applications/blender.app/Contents/Resources/2.77/scripts/addons/io_scene_obj/import_obj.py", line 1165, in load unique_material_images, use_image_search, float_func) File "/Applications/blender.app/Contents/Resources/2.77/scripts/addons/io_scene_obj/import_obj.py", line 401, in create_materials load_material_image(context_material, context_material_name, img_data, 'Ka') File "/Applications/blender.app/Contents/Resources/2.77/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 "/Applications/blender.app/Contents/Resources/2.77/scripts/addons/io_scene_obj/import_obj.py", line 71, in obj_image_load return load_image(imagepath, DIR, recursive=recursive, place_holder=True, relpath=relpath) File "/Applications/blender.app/Contents/MacOS/../Resources/2.77/scripts/modules/bpy_extras/image_utils.py", line 199, in load_image return _image_load_placeholder(imagepath) File "/Applications/blender.app/Contents/MacOS/../Resources/2.77/scripts/modules/bpy_extras/image_utils.py", line 86, in _image_load_placeholder image = bpy.data.images.new(name, 128, 128) ``` TypeError: BlendDataImages.new(): error with argument 1, "name" - Function.name error assigning string, UnicodeEncodeError('utf-8' codec can't encode character '\udcc7' in position 0: surrogates not allowed) location: <unknown location>:-1 **Exact steps for others to reproduce the error** This only happens when importing .obj files. Steps to reproduce. 1.Unzip file with .obj in it. 2.Go to File > Import > Wavefront(.obj) 3.navigate to where the files location 4. try to import object and you will get the error. [SheHulk.zip](https://archive.blender.org/developer/F299183/SheHulk.zip)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @apoclypse

Added subscriber: @apoclypse

Added subscriber: @sindra1961

Added subscriber: @sindra1961

I can not reproduce this here.

Windows 10 pro 64bits
import.png

I can not reproduce this here. Windows 10 pro 64bits ![import.png](https://archive.blender.org/developer/F299245/import.png)
Campbell Barton self-assigned this 2016-03-29 07:24:23 +02:00

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

This issue was referenced by blender/blender@2fae1719f8

This issue was referenced by blender/blender@2fae1719f82c10e3ac2bfba7cc45f2534a0b1a02
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 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#47986
No description provided.