Exported OBJ file cannot be imported #78533

Closed
opened 2020-07-02 15:03:23 +02:00 by Sybren A. Stüvel · 5 comments

Blender version: current soc-2020-io-performance branch, 42a8ea1af3

Expected behaviour:

I expect to be able to export a simple mesh with the new OBJ exporter, and import it with the existing Python-based OBJ importer.

Observed behaviour:

Importing fails with this output on the terminal:

(  0.0001 sec |   0.0001 sec) Importing OBJ '/home/sybren/tmp/obj-export-test.obj'...
  (  0.0006 sec |   0.0001 sec) Parsing OBJ file...
    (  0.0134 sec |   0.0117 sec) Done, loading materials and images...
Progress:  33.33%

Traceback (most recent call last):
  File "/home/sybren/workspace/blender-git/build_linux/bin/2.90/scripts/addons/io_scene_obj/__init__.py", line 146, in execute
    return import_obj.load(context, **keywords)
  File "/home/sybren/workspace/blender-git/build_linux/bin/2.90/scripts/addons/io_scene_obj/import_obj.py", line 1244, in load
    use_image_search, float_func)
  File "/home/sybren/workspace/blender-git/build_linux/bin/2.90/scripts/addons/io_scene_obj/import_obj.py", line 443, in create_materials
    context_material_name, img_data, line, 'Kd')
  File "/home/sybren/workspace/blender-git/build_linux/bin/2.90/scripts/addons/io_scene_obj/import_obj.py", line 187, in load_material_image
    _generic_tex_set(mat_wrap.base_color_texture, image, 'UV', map_offset, map_scale)
  File "/home/sybren/workspace/blender-git/build_linux/bin/2.90/scripts/addons/io_scene_obj/import_obj.py", line 183, in _generic_tex_set
    nodetex.scale = scale
  File "/home/sybren/workspace/blender-git/build_linux/bin/2.90/scripts/modules/bpy_extras/node_shader_utils.py", line 36, in wrapper
    return func(self, *args, **kwargs)
  File "/home/sybren/workspace/blender-git/build_linux/bin/2.90/scripts/modules/bpy_extras/node_shader_utils.py", line 822, in scale_set
    self.node_mapping.inputs['Scale'].default_value = scale
ValueError: bpy_struct: item.attr = val: sequences of dimension 0 should contain 3 items, not 2

location: <unknown location>:-1

To reproduce:

  • Open the attached blend file.
  • Export with the New OBJ exporter, all options at their default values.
  • Import with the Wavefront OBJ importer.
  • See the error.

Here are the blend file:

obj-export-test.blend

and the OBJ+MTL file that were exported:
obj-export-test.obj

obj-export-test.mtl

**Blender version:** current `soc-2020-io-performance` branch, 42a8ea1af3 **Expected behaviour:** I expect to be able to export a simple mesh with the new OBJ exporter, and import it with the existing Python-based OBJ importer. **Observed behaviour:** Importing fails with this output on the terminal: ``` ( 0.0001 sec | 0.0001 sec) Importing OBJ '/home/sybren/tmp/obj-export-test.obj'... ( 0.0006 sec | 0.0001 sec) Parsing OBJ file... ( 0.0134 sec | 0.0117 sec) Done, loading materials and images... Progress: 33.33% Traceback (most recent call last): File "/home/sybren/workspace/blender-git/build_linux/bin/2.90/scripts/addons/io_scene_obj/__init__.py", line 146, in execute return import_obj.load(context, **keywords) File "/home/sybren/workspace/blender-git/build_linux/bin/2.90/scripts/addons/io_scene_obj/import_obj.py", line 1244, in load use_image_search, float_func) File "/home/sybren/workspace/blender-git/build_linux/bin/2.90/scripts/addons/io_scene_obj/import_obj.py", line 443, in create_materials context_material_name, img_data, line, 'Kd') File "/home/sybren/workspace/blender-git/build_linux/bin/2.90/scripts/addons/io_scene_obj/import_obj.py", line 187, in load_material_image _generic_tex_set(mat_wrap.base_color_texture, image, 'UV', map_offset, map_scale) File "/home/sybren/workspace/blender-git/build_linux/bin/2.90/scripts/addons/io_scene_obj/import_obj.py", line 183, in _generic_tex_set nodetex.scale = scale File "/home/sybren/workspace/blender-git/build_linux/bin/2.90/scripts/modules/bpy_extras/node_shader_utils.py", line 36, in wrapper return func(self, *args, **kwargs) File "/home/sybren/workspace/blender-git/build_linux/bin/2.90/scripts/modules/bpy_extras/node_shader_utils.py", line 822, in scale_set self.node_mapping.inputs['Scale'].default_value = scale ValueError: bpy_struct: item.attr = val: sequences of dimension 0 should contain 3 items, not 2 location: <unknown location>:-1 ``` To reproduce: - Open the attached blend file. - Export with the New OBJ exporter, all options at their default values. - Import with the Wavefront OBJ importer. - See the error. Here are the blend file: [obj-export-test.blend](https://archive.blender.org/developer/F8659725/obj-export-test.blend) and the OBJ+MTL file that were exported: [obj-export-test.obj](https://archive.blender.org/developer/F8659726/obj-export-test.obj) [obj-export-test.mtl](https://archive.blender.org/developer/F8659727/obj-export-test.mtl)
Ankit Meel was assigned by Sybren A. Stüvel 2020-07-02 15:03:23 +02:00
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member

Added subscribers: @dr.sybren, @howardt

Added subscribers: @dr.sybren, @howardt
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Member

Fixed. Though I'm still confused as to why an UV mapping node was taken as SH_NODE_TEX_IMAGE.
Checking on that.
68807cf466

Fixed. Though I'm still confused as to why an UV mapping node was taken as `SH_NODE_TEX_IMAGE`. Checking on that. 68807cf466
Member

Oh never mind, it was named "UV Grid", it was still an Image texture node.

Oh never mind, it was named "UV Grid", it was still an Image texture node.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 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#78533
No description provided.