Skip to content

Commit 1d35ea7

Browse files
committed
Fix bug where we try add materials when there are none
1 parent a4d62b3 commit 1d35ea7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

io_scene_a3d/A3DBlenderImporter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ def buildBlenderMesh(self, meshData):
163163
# Apply materials (version 2)
164164
faceIndexBase = 0
165165
for submeshI, submesh in enumerate(meshData.submeshes):
166-
if submesh.materialID == None:
166+
if submesh.materialID == None or len(self.materials) == 0: #XXX: perhaps try add a material slot to the object so we still make use of the submesh data instead of skipping it when there are no materials?
167+
# if materialID is None then this is a version 3 model submesh
167168
continue
168169
me.materials.append(self.materials[submesh.materialID])
169170
for faceI in range(submesh.indexCount//3):

0 commit comments

Comments
 (0)