Posted: Sun Feb 08, 2009 5:12 am
Rise from yer grave! (well, it's not that old yet)
So this is the reason why Blender can't load some DirectX models. The Blender itself doesn't support more that 16 materials. Good grief...
Someone might have seen this "list can't have more than 16 materials" error when importing DirectX model fails, it's caused by this limitation.
I hacked DirectX8Importer.py so it ignores materials whose id is larger than 16, so now I can actually load models - though their material data is partially gone. Annoying...
Here's the hack if someone is interested:
Is there any possibilities to actually get rid of this silly limitation?
So this is the reason why Blender can't load some DirectX models. The Blender itself doesn't support more that 16 materials. Good grief...
Someone might have seen this "list can't have more than 16 materials" error when importing DirectX model fails, it's caused by this limitation.
I hacked DirectX8Importer.py so it ignores materials whose id is larger than 16, so now I can actually load models - though their material data is partially gone. Annoying...
Here's the hack if someone is interested:
Code: Select all
def loadMeshMaterials(self, nr_fc_mat, mesh):
for face in mesh.faces:
nr_fc_mat += 1
line = self.lines[nr_fc_mat]
fixed_line = self.CleanLine(line)
wrd = fixed_line.split()
mat_idx = int(wrd[0])
# Ignore material with illegal index
if (mat_idx>=15) :
print "Ignoring material: ",mat_idx
mat_idx=0
face.mat = mat_idx