So we have been brought in to work on a really old project which is using FaceFX(1.7.4) in UDK 3. This version of FaceFX does not have a way to export to FBX. It does however let you export to an XML Actor. Great! The plan is to write a parser to translate this information back in Maya to apply the animations to the base rig. I've got a good start to this but i cant seem to figure out how the rotation values get applied to the joints in maya.
Here is an example of the kinda data that im trying to parse:
0.781784 -2.375797 -0.000000 -0.543797 -0.000012 0.000107 -0.839217 1.000000 1.000000 1.000000
I assume the first 3 values are translate and the last 3 are scale and the middle 4 values are Quaternions for the rotation. When i try and apply these rotation values in Maya via a MFnTransform.setRotationQuaternion, the resulting rotation is incorrect. I assume the values stored in the XML don't exactly line up with the x, y, z, w order that Maya is expecting or the coordinate system are not the same.
The expected rotation for the joint should be:
-0.011, 0.005, -114.115
Any idea what course of action i should pursue?
Thanks in advance!
Your assumption about the data is correct. It is in the form:
pos.x pos.y pos.z quat.w quat.x quat.y quat.z scale.x scale.y scale.z
This data is in the bone's "parent" space.
Try negating the quat.w component, sometimes that is necessary.
But perhaps you can get around the problem a different way. Why not import the xml actor into the FaceFX Maya plugin, then import the pose or animations from there?
http://files.facefx.com.s3.amazonaws.com/Setup_FaceFX_Plugins_2015.2.exe
Finally, there are some differences between the XML format in UE3 and the current one. I don't think they will get in your way since you are getting data out, but just in case, take a look at this thread:
https://facefx.com/forums/exporting-facefx-animation-udk
I was able to finally get this working.
For future reference i wrote this bit of code:
import math
import maya.api.OpenMaya as om
def QuaternionToEuler( w, x, y, z ):
quaternion = om.MQuaternion(x, y, z, -w)
euler = quaternion.asEulerRotation()
return map(math.degrees, euler)
I saw your reply only after I got this working... Anyways its all good now :)