Anyone know why we have this silly limitation in Blender?

The interface, modeling, 3d editing tools, import/export, feature requests, etc

Moderators: jesterKing, stiv

Jaenis
Posts: 0
Joined: Sun Feb 08, 2009 4:57 am

Post by Jaenis »

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:

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
Is there any possibilities to actually get rid of this silly limitation?

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv »

Is there any possibilities to actually get rid of this silly limitation?
Feel free to submit a patch. No, I'm not being snarky. Features get added when someone cares enough about it to do the work. Right now the development team has bigger fish to fry.

And try not to use the word 'siily'. It makes you appear ignorant.

Post Reply