mirror of
https://github.com/MapMakersAndProgrammers/io_scene_a3d.git
synced 2025-10-26 01:49:13 -07:00
Fix bug where we try add materials when there are none
This commit is contained in:
@@ -163,7 +163,8 @@ class A3DBlenderImporter:
|
|||||||
# Apply materials (version 2)
|
# Apply materials (version 2)
|
||||||
faceIndexBase = 0
|
faceIndexBase = 0
|
||||||
for submeshI, submesh in enumerate(meshData.submeshes):
|
for submeshI, submesh in enumerate(meshData.submeshes):
|
||||||
if submesh.materialID == None:
|
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?
|
||||||
|
# if materialID is None then this is a version 3 model submesh
|
||||||
continue
|
continue
|
||||||
me.materials.append(self.materials[submesh.materialID])
|
me.materials.append(self.materials[submesh.materialID])
|
||||||
for faceI in range(submesh.indexCount//3):
|
for faceI in range(submesh.indexCount//3):
|
||||||
|
|||||||
Reference in New Issue
Block a user