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...
This commit is contained in:
Bastien Montagne 2019-06-03 11:58:25 +02:00
parent c5452a6217
commit d79fa2c042
Notes: blender-bot 2023-02-14 19:14:25 +01:00
Referenced by issue blender/blender#65326, OBJ import is broken
Referenced by issue #65597, Error import *.OBJ format
2 changed files with 4 additions and 2 deletions

View File

@ -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",

View File

@ -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''