From d79fa2c042e34e1639030b06ff762673a0a68803 Mon Sep 17 00:00:00 2001 From: Bastien Montagne <montagne29@wanadoo.fr> Date: Mon, 3 Jun 2019 11:58:25 +0200 Subject: [PATCH] Fix T65326: OBJ import is broken when no material is in OBJ file. Caused by rB8252cc7044ea (fix for T65215), we actually need a default material in edges-only case too, not to exclude None (default) one in that case... --- io_scene_obj/__init__.py | 2 +- io_scene_obj/import_obj.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/io_scene_obj/__init__.py b/io_scene_obj/__init__.py index e7253ea70..15f2d2a0e 100644 --- a/io_scene_obj/__init__.py +++ b/io_scene_obj/__init__.py @@ -21,7 +21,7 @@ bl_info = { "name": "Wavefront OBJ format", "author": "Campbell Barton, Bastien Montagne", - "version": (3, 5, 8), + "version": (3, 5, 9), "blender": (2, 80, 0), "location": "File > Import-Export", "description": "Import-Export OBJ, Import OBJ mesh, UV's, materials and textures", diff --git a/io_scene_obj/import_obj.py b/io_scene_obj/import_obj.py index 09cf7efc1..c565bd050 100644 --- a/io_scene_obj/import_obj.py +++ b/io_scene_obj/import_obj.py @@ -520,7 +520,7 @@ def split_mesh(verts_loc, faces, unique_materials, filepath, SPLIT_OB_OR_GROUP): face_vert_loc_indices[loop_idx] = map_index # remap to the local index - if context_material is not None and context_material not in unique_materials_split: + if context_material not in unique_materials_split: unique_materials_split[context_material] = unique_materials[context_material] faces_split.append(face) @@ -1104,6 +1104,8 @@ def load(context, # as a polyline, and not a regular face... face[1][:] = [True] faces.append(face) + if context_material is None: + use_default_material = True # Else, use face_vert_loc_indices previously defined and used the obj_face context_multi_line = b'l' if strip_slash(line_split) else b'' -- GitLab