MD2 import script for Blender 2.63

Hi

As I’m fed up being forced to use only Blender 2.49 because I need working MD2 import and export scripts, after having fixed a tiny bug (the frame 0 could not be modified but my fix shifts all indices), I have just tried to port the MD2 import script from 2.49 to 2.63. I’m not a Python programmer and I find the documentation of the API a bit poor. There are a few remaining things to fix:

  • I have not succeeded to port the GUI (there was only a second file chooser for the texture and a slider for the scale)
  • I have some problems to create the mesh and the mesh data
  • I don’t know how to replace some calls of extend()
  • I haven’t succeeded in passing the correct filename

Could someone help me to solve my remaining problems so that the whole community can benefit of this script? I’m under GNU Linux, I cannot use any other modeler to import MD2 models and actually, I don’t want to abandon Blender. I had not programmed in Python for 8 years, I feel more comfortable with Java. I have just tried to upload it here but I have a warning “Invalid file” :mad:

You can upload it to somewhere like pasteall.org and post the link here.

I have zipped it so that I don’t get the warning, please find it enclosed. I was tired yesterday, it was midnight in France.

Attachments

md2_import_Blender2.63.py.zip (6.34 KB)

I still have some errors:
Traceback (most recent call last):
File “/tmp/quit.blend/md2_import_Blender2.63.py.028”, line 654, in execute
File “/tmp/quit.blend/md2_import_Blender2.63.py.028”, line 513, in load_md2
AttributeError: ‘bpy_prop_collection’ object has no attribute ‘extend’

Traceback (most recent call last):
File “/tmp/quit.blend/md2_import_Blender2.63.py.029”, line 654, in execute
File “/tmp/quit.blend/md2_import_Blender2.63.py.029”, line 517, in load_md2
AttributeError: ‘Mesh’ object has no attribute ‘faceUV’

thank you for this

thanks!, do you know if there’s some addon like this for 2.71 version?

╭∩╮(︶︿︶)╭∩╮
╭∩╮(︶︿︶)╭∩╮
╭∩╮(︶︿︶)╭∩╮
╭∩╮(︶︿︶)╭∩╮
╭∩╮(︶︿︶)╭∩╮