I’ve been working on fixing up some problems in the md3 exporter script as described in the following thread:
The main area of change is in the tags. The tags were previously not written out correctly. After a few small changes, any selected empties are now written out as md3 tags. The problem I have is that a tag consists of an origin along with an x, y and z axis (rather than a normal vector). When I look at the output (I wrote a little md3 disassembler), the x, y and z axes are all identical. The script and also the viewer is in the zip file below.
I figure that it must be something to do with my understanding of blender’s coordinate system. The code snippet that initialises the tag structure looks as follows:
for fr in range(1, NUM_FRAMES+1): Blender.Set("curframe", fr) for tag in tag_list: t = md3_tag() matrix = tag.getMatrix('worldspace') for i in range(0,3): t.axis.co[i] = matrix[i] t.axis.co[i] = matrix[i] t.axis.co[i] = matrix[i] t.origin.co[i] = matrix[i] t.name = tag.name md3.tags.append(t)
The end result would appear to be that t.axis == t.axis == t.axis
which isn’t what I want. I need t.axis to be the local x-axis, t.axis to be the local y-axis etc.
Can someone please help. Without working tag support, the md3 exporter cannot be used for player models because the tags are necessary to align the various bits of the player (head, torso, legs and weapon).