may as well add something useful to the thread...
Calculating Transforms:
as for returning the matrices to be calculated with a vert,
you will have to inverse them after retrieving them
then append them to a matrix list:
matrix_list = [M1,M1,M2,M4]
then append that to a transform list:
Transform_list = [[M3,M0],[M1,M1,M2,M4],[M5]]
once you have that you can use facepoint[0]/3 to give you the index of the transform:
calc_transform(Transform_list[facepoint[0]/3],Vert_list[facepoint[9]])
the calc_transform function above would multiply the current matrix with the vert to give you the transformed vert.
but it only sounds simple...
to get the transformed vert, you'd have get the value from each matrix in the group,
and then add the values together
as for calculating a single matrix:
TX = (VX*M[0])+(VY*M[1])+(VZ*M[2])+M[3]
TY = (VX*M[4])+(VY*M[5])+(VZ*M[6])+M[7]
TZ = (VX*M[8])+(VY*M[9])+(VZ*M[10])+M[11]
this would get you the transform value for a single matrix in a group
once you've calculated all the values for the matrices, add the values together
I personally prefer this method:
Code:
def calcTransform( matrices, vert ): #to be performed on the current vert
tx,ty,tz = 0,0,0
for mtx in matrices:
matrix = mtx
tx += (vert[0]*matrix[0]) + (vert[1]*matrix[1]) + (vert[2]*matrix[2]) + matrix[3]
ty += (vert[0]*matrix[4]) + (vert[1]*matrix[5]) + (vert[2]*matrix[6]) + matrix[7]
tz += (vert[0]*matrix[8]) + (vert[1]*matrix[9]) + (vert[2]*matrix[10]) + matrix[11]
#transform to be added to vert (during export conversion)
return [ tx-vert[0] , ty-vert[1] , tz-vert[2] ]
where 'matrices' would be the current transform group,
and 'vert' would be the current vert you're applying
now you have your transformed vert
I only subtract the vert from the transform vert because of the fact that my format gives you the option weather or not to apply the transfroms to the verts
thus you can chooze between the RAW vert positions and the transformed positions