Page 5 of 7

Posted: Mon Jun 26, 2006 12:23 pm
by surfmasta
Hi, i'm using version 0.17.4 of the md2-exporter in blender 2.41 and it destroys my simple model. Can you take a look on it? I have a UV-mapped version where the same problem happens, but the main problem is, that some of the vertex-points are in the wrong position.
Blender-Model -> http://netster.de/public/rupee.blend

Posted: Mon Jun 26, 2006 6:54 pm
by scourage
The problem is that your object is scaled, press the N key in the 3d view window when in object mode and look a the size. To fix this simply change the size of the object to 1.0 for x, y, and z. I have added a check for this in the new script.

cheers,

Bob

It works!

Posted: Sun Jul 02, 2006 2:26 am
by arkdm
I just exported a model and it worked! No messed up geometry or anything! Still have to test it on a few more mod's but I think it's gonna work this time.

Thanks so much Bob!

Posted: Mon Jul 03, 2006 5:42 am
by arkdm
Ok - I was wrong. The exporter is messing up a model I'm trying to export: http://arkfamily.org/MZ/Animated_man.blend.

Any ideas?

Posted: Thu Jul 06, 2006 10:17 pm
by scourage
I'm assuming you want to export the first model (however all of them have the same issues). There are several problems with it, it is not centred, the object (not the mesh verts) are scaled and rotated. The new script moves the model, and since the armature is not moved with the model, it screws it all up. You need to select your model (not the armature) and go into it's modifier stack. You need to press the "make real" button for the parent armature since this is an old blender file. Since the model and the armature are not at the same location or at the origin, plus the model isn't animated, you need to press the "apply" button in the armature modifier (which will remove it-keeping the model). Then you need to press the "N" key in the 3d window and change all the location/rotation to 0.0 and all the size values to 1.0. Then try exporting it. It works for me that way.

There is a tutorial in the works for this exporter, but it may be a while.

Cheers,

Bob

Posted: Fri Jul 07, 2006 7:56 pm
by arkdm
I followed your instructions, and it's still coming up a little weird. Could you maybe send the blend with the changes you made?

I'd also like to thank you for all the help you've provided with this issue. Has made things a TON easier.

Posted: Mon Jul 10, 2006 10:18 pm
by I.C.
i hope somebody can help me...

my mesh getting destroyed after exporting...

klick for an before/after-image

i used the Armature Modifer and Bones for an 80 Frames Animation...

The Games Convention came near and i have to export some more models so i hope somebody can help me soon :wink:

Posted: Wed Jul 12, 2006 4:11 pm
by scourage
arkdm,

I'll send you the blend with the changes this afternoon.

I.C.,
can you send me your blend to see why it's failing?

Cheers,

Bob

Posted: Thu Jul 13, 2006 3:53 pm
by I.C.
scourage,

this is the blend:

RamrodMD2.blend

thanks for your help :)

Posted: Fri Jul 14, 2006 9:53 pm
by scourage
Nice model. I'm not sure (just yet) why it's not exporting properly. I'll look into this weekend more.

cheers,

Bob

Posted: Wed Jul 19, 2006 5:55 am
by arkdm
Any luck with the blend Bob?

Posted: Wed Jul 19, 2006 5:56 pm
by schmidti
i also got some problems with the export. it seems the bounding-box stuff doesn't work. the min- and max-values are wrong so the translate and scale values for each frame.
replacing the bounding-box code from line 844 to 860 works for me.

Code: Select all

		frame_min_x=mesh.verts[0].co[1]
		frame_max_x=mesh.verts[0].co[1]
		frame_min_y=mesh.verts[0].co[0]
		frame_max_y=mesh.verts[0].co[0]
		frame_min_z=mesh.verts[0].co[2]
		frame_max_z=mesh.verts[0].co[2]

		for vert_counter in range(0, md2.num_vertices):
			if frame_min_x>mesh.verts[vert_counter].co[1]: frame_min_x=mesh.verts[vert_counter].co[1]
			if frame_max_x<mesh.verts[vert_counter].co[1]: frame_max_x=mesh.verts[vert_counter].co[1]
			if frame_min_y>mesh.verts[vert_counter].co[0]: frame_min_y=mesh.verts[vert_counter].co[0]
			if frame_max_y<mesh.verts[vert_counter].co[0]: frame_max_y=mesh.verts[vert_counter].co[0]
			if frame_min_z>mesh.verts[vert_counter].co[2]: frame_min_z=mesh.verts[vert_counter].co[2]
			if frame_max_z<mesh.verts[vert_counter].co[2]: frame_max_z=mesh.verts[vert_counter].co[2]	
there is one more bug in line 1190 and 1191: a casting to float is required otherwise the pure integer division will return an integer. it would be always 0.

Code: Select all

				cmd.s=float(s)/md2.skin_width
				cmd.t=float(t)/md2.skin_height
Peter

Posted: Thu Jul 20, 2006 1:05 pm
by I.C.
thanks a lot for your help :D

(Shame on me) i don`t unstand the changes that i have to make...

can you show me the complete fixed code, pleaaaaaaaaaaase :oops: :D

Posted: Thu Jul 20, 2006 1:28 pm
by schmidti
EDIT:
the code won't work

Posted: Thu Jul 20, 2006 4:49 pm
by I.C.
with the fixed code has still the same problem... my mesh is getting destroyed :(