Operating system: MS Windows 8.1
Graphics card: Nvidia GTX 980M
Broken: 2.80, 1fa527bfa3a
Worked: 2.79, 5bd8ac9
Short description of error
Attempting to import an OBJ file will fail when the object in the file has vertex groups defined, the 'Keep Vertex Order' button is selected and the Polygroups option checkbox is checked in the import options. See attached image for full error message.
Exact steps for others to reproduce the error
- In default startup, create a cube and subdivide 4 times to give a 4x4 cube.
- Define two vertex groups and assign half the vertices to one vertex group and the remaining vertices to the other.
- Export the cube to OBJ file, checking Keep Vertex Order and Polygroups options.
- Import the file exported at step 3, selecting Keep Vertex Order and Polygroups in the import options.
- The file is not imported and the error message appears.
- Attempt to import the file again, but deselect the Polygroups option, or do not select Keep Vertex Order and hence not Polygroups either. The import now succeeds.
The error can be circumvented by updating the file scripts/addons/io_scene_obj/import_obj.py. The penultimate line of the create_mesh function - on my system line 713 - reads:
group = ob.vertex_groups.new(group_name.decode('utf-8', "replace"))
Simply updating it to read:
group = ob.vertex_groups.new(name=group_name.decode('utf-8', "replace"))
This may of course not be a complete or indeed entirely correct solution.
seems to have solved the problem for me.