exporting pose bone > vertex animation help

I need help on how to export vertex animation dealing with pose bone that is base on unreal format. I try couple of code and it not working.

unreal format is base on vertex animation.


#This code in for pose action bone
                    quat = grassman(quat, pose_bone.quat)
                    #tail = (pose_bone.quat * (tail-head)) + head + pose_bone.loc
                    if blender_bone.hasParent():
                        child_parent = pose_bone.parent    #print "parent:",blender_bone.name
                        #print dir(child_parent.quat)
                        quat_parent = child_parent.quat.inverse()
                        parent_head = child_parent.head * quat_parent
                        parent_tail = child_parent.tail * quat_parent
                        head = pose_bone.head #some what work
                    else:
                        head = pose_bone.head