Errors on OBJ import #60381

Closed
opened 2019-01-10 05:57:40 +01:00 by SagRU · 10 comments

System Information
Operating system: Windows 10 Pro 64Bit
Graphics card: Intel HD Graphics 530

Blender Version
Broken: 2.80, January 08, 01:07:30 - 91a155833e59
Worked: 2.79b

Short description of error
When I try to import my OBJ model, I get these errors in console:

(  0.0000 sec |   0.0000 sec) Importing OBJ 'C:\\cygwin64\\home\\user\\RendererAPI\\files\\renders\\render_794\\project.obj'...
  (  0.0010 sec |   0.0010 sec) Parsing OBJ file...
    (  1.3310 sec |   1.3301 sec) Done, loading materials and images...
WARNING, currently unsupported 'tr' translucency option, skipped.


Traceback (most recent call last):
  File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\addons\io_scene_obj\__init__.py", line 145, in execute
    return import_obj.load(context, **keywords)
  File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\addons\io_scene_obj\import_obj.py", line 1173, in load
    use_image_search, float_func)
  File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\addons\io_scene_obj\import_obj.py", line 397, in create_materials
    context_material_name, img_data, line, 'Kd')
  File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\addons\io_scene_obj\import_obj.py", line 139, in load_material_image
    _generic_tex_set(mat_wrap.base_color_texture, image, 'UV', map_offset, map_scale)
  File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\addons\io_scene_obj\import_obj.py", line 135, in _generic_tex_set
    nodetex.scale = scale
  File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\modules\bpy_extras\node_shader_utils.py", line 37, in wrapper
    return func(self, *args, **kwargs)
  File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\modules\bpy_extras\node_shader_utils.py", line 733, in scale_set
    self.node_mapping.scale = scale
TypeError: bpy_struct: item.attr = val: expected sequence items of type float, not bytes

location: <unknown location>:-1

location: <unknown location>:-1

I removed all "Tr" parameters from corresponding MTL file, but it didn't help much:

(  0.0000 sec |   0.0000 sec) Importing OBJ 'D:\\Render_Test\\project.obj'...
  (  0.0020 sec |   0.0020 sec) Parsing OBJ file...
    (  1.3280 sec |   1.3260 sec) Done, loading materials and images...
    (  1.3310 sec |   1.3290 sec) Done, building geometries (verts:98496 faces:32564 materials: 7 smoothgroups:0) ...
Error: Array length mismatch (expected 63072, got 63000)


Traceback (most recent call last):
  File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\addons\io_scene_obj\__init__.py", line 145, in execute
    return import_obj.load(context, **keywords)
  File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\addons\io_scene_obj\import_obj.py", line 1201, in load
    dataname,
  File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\addons\io_scene_obj\import_obj.py", line 674, in create_mesh
    me.uv_layers[0].data.foreach_set("uv", loops_uv)
RuntimeError: internal error setting the array

location: <unknown location>:-1

location: <unknown location>:-1

Exact steps for others to reproduce the error

  1. Download an attached model
  2. Open Blender 2.8
  3. Try to import the model as Wavefront (OBJ)

Render_Test.zip

**System Information** Operating system: Windows 10 Pro 64Bit Graphics card: Intel HD Graphics 530 **Blender Version** Broken: 2.80, January 08, 01:07:30 - 91a155833e59 Worked: 2.79b **Short description of error** When I try to import my OBJ model, I get these errors in console: ``` ( 0.0000 sec | 0.0000 sec) Importing OBJ 'C:\\cygwin64\\home\\user\\RendererAPI\\files\\renders\\render_794\\project.obj'... ( 0.0010 sec | 0.0010 sec) Parsing OBJ file... ( 1.3310 sec | 1.3301 sec) Done, loading materials and images... WARNING, currently unsupported 'tr' translucency option, skipped. Traceback (most recent call last): File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\addons\io_scene_obj\__init__.py", line 145, in execute return import_obj.load(context, **keywords) File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\addons\io_scene_obj\import_obj.py", line 1173, in load use_image_search, float_func) File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\addons\io_scene_obj\import_obj.py", line 397, in create_materials context_material_name, img_data, line, 'Kd') File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\addons\io_scene_obj\import_obj.py", line 139, in load_material_image _generic_tex_set(mat_wrap.base_color_texture, image, 'UV', map_offset, map_scale) File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\addons\io_scene_obj\import_obj.py", line 135, in _generic_tex_set nodetex.scale = scale File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\modules\bpy_extras\node_shader_utils.py", line 37, in wrapper return func(self, *args, **kwargs) File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\modules\bpy_extras\node_shader_utils.py", line 733, in scale_set self.node_mapping.scale = scale TypeError: bpy_struct: item.attr = val: expected sequence items of type float, not bytes location: <unknown location>:-1 location: <unknown location>:-1 ``` I removed all "Tr" parameters from corresponding MTL file, but it didn't help much: ``` ( 0.0000 sec | 0.0000 sec) Importing OBJ 'D:\\Render_Test\\project.obj'... ( 0.0020 sec | 0.0020 sec) Parsing OBJ file... ( 1.3280 sec | 1.3260 sec) Done, loading materials and images... ( 1.3310 sec | 1.3290 sec) Done, building geometries (verts:98496 faces:32564 materials: 7 smoothgroups:0) ... Error: Array length mismatch (expected 63072, got 63000) Traceback (most recent call last): File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\addons\io_scene_obj\__init__.py", line 145, in execute return import_obj.load(context, **keywords) File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\addons\io_scene_obj\import_obj.py", line 1201, in load dataname, File "C:\Users\user\Desktop\blender-2.80.0-git.91a155833e59-windows64\2.80\scripts\addons\io_scene_obj\import_obj.py", line 674, in create_mesh me.uv_layers[0].data.foreach_set("uv", loops_uv) RuntimeError: internal error setting the array location: <unknown location>:-1 location: <unknown location>:-1 ``` **Exact steps for others to reproduce the error** 1) Download an attached model 2) Open Blender 2.8 2) Try to import the model as Wavefront (OBJ) [Render_Test.zip](https://archive.blender.org/developer/F6237180/Render_Test.zip)
Author

Added subscriber: @WannaBe

Added subscriber: @WannaBe
Member

Added subscribers: @mont29, @lichtwerk

Added subscribers: @mont29, @lichtwerk
Bastien Montagne was assigned by Philipp Oeser 2019-01-10 09:43:57 +01:00
Member

Regarding the translucency error: could you share the MTL without 'Tr' being removed?
[easier to repro and fix the first issue]

Can confirm the UV mismatch.
@mont29 might know right away? (feel free to throw back at me and I will investigate more...)
[This might not be a bug but a broken OBJ though... where has this been exported from?]

Regarding the `translucency` error: could you share the MTL without 'Tr' being removed? [easier to repro and fix the first issue] Can confirm the UV mismatch. @mont29 might know right away? (feel free to throw back at me and I will investigate more...) [This might not be a bug but a broken OBJ though... where has this been exported from?]
Member

note: this is coming in without errors in 2.79...

note: this is coming in without errors in 2.79...

UV error comes from the fact that this .obj has two objects named the same ('_1'), I think… will check and fix that (2.79 seems to always fully merge those into a single mesh, while it looks like 2.8 does an hybrid work which generates that mismatch in UV numbers).

original report, the warning itself is nothing wrong, just some unsupported feature. the actual error I'll need unmodified MTL again to investigate.

UV error comes from the fact that this .obj has two objects named the same ('_1'), I think… will check and fix that (2.79 seems to always fully merge those into a single mesh, while it looks like 2.8 does an hybrid work which generates that mismatch in UV numbers). original report, the warning itself is nothing wrong, just some unsupported feature. the actual error I'll need unmodified MTL again to investigate.

UV part is fixed, marking as incomplete until we get original MTL to investigate material issue.

UV part is fixed, marking as incomplete until we get original MTL to investigate material issue.
Author

Here's a pure MTL file (as exported from a three.js app):
materials_untouched.zip

Here's a pure MTL file (as exported from a three.js app): [materials_untouched.zip](https://archive.blender.org/developer/F6248099/materials_untouched.zip)
Author

It seems that missing textures break the import. When I remove all Kd lines, the importer works fine. In 2.79b it wasn't a road-block.

It seems that missing textures break the import. When I remove all Kd lines, the importer works fine. In 2.79b it wasn't a road-block.

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

fixed in 5509187b4d, thanks.

fixed in 5509187b4d, thanks.
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#60381
No description provided.