debugging export_md2

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
Posts: 0
Joined: Wed Nov 02, 2005 12:36 pm

debugging export_md2

Post by Hoehrer »

I'm currently trying to debug the md2_export script (see here for more info on this subject) and i really can't find what's going wrong. Everything looks fine to me.

This the the error-message i get after selecting a file-name and hitting "export".

Code: Select all

Traceback (most recent call last):
  File "<string>", line 141, in bevent
  File "<string>", line 1001, in save_md2
  File "<string>", line 499, in validation
RuntimeError: couldn't load image data in Blender
... where line 499 is empty in the script, but this is the surrounding area:

Code: Select all

489	for face in mesh.faces:
490		mesh_image=face.image
491		if not mesh_image:
492			print "Model has a face without a texture Map"
493			result=Blender.Draw.PupMenu("Model has a face without a texture Map%t|OK")
494			return False
495		if mesh_image!=last_face:
496			print "Model has more than 1 texture map assigned"
497			result=Blender.Draw.PupMenu("Model has more than 1 texture map assigned%t|OK")
498			return False
501	size=mesh_image.getSize()
502	#is this really what the user wants
503	if (size[0]!=256 or size[1]!=256):
504		print "Texture map size is non-standard (not 256x256), it is: ",size[0],"x",size[1]
505		result=Blender.Draw.PupMenu("Texture map size is non-standard (not 256x256), it is: "+size[0]+"x"+size[1]+": Continue?%t|YES|NO")
506		if(result==2):
507			return False
What is going wrong here. The mesh has one texture that is an external image mapped to UV.
According to ... class.html the function is used correctly as well.

Thanks for every help,

Post Reply