The easiest way within maya is to either use the maya api ( which you can call through python ) and use the MTransformationMatrix class which you can set rotation/translation etc, then feed out the matrix.
Alternatively, if you’re not that keen on scripting you could potentially cheat it and pump those values into a temporary object and then read the matrix from that using the xform command.
If you’re running over a lot of objects the first method will be much quicker.
Hope that helps.
I have a partner handling the Maya wrangling. I have my own 3D code (Objective-C) that consumes the above data. All I really need to know is the order of matrix concatenation.
For example is it (ignoring scale for the moment): T * Rx * Ry * Rz -> TransformationMatrix?
Where can learn more about the API? Is there an Objective-C binding?
Thanks very much. I am actually working with a partner on this project who is handling the Maya end. I have my own custom 3D software that takes a 4x4 matrix as input. What should I tell my partner to setup the composeMatrix node?
The reason I referenced the other form is because of the skill set of the people who populate it. This is a generalist form, mostly populated by artists who may or may not know what a transformation matrix is ... except maybe a famous movie franchise tie-in. (That’s not a slam against anyone, its just outside the normal scope of knowledge for most)
To visually see how everything exists in Maya:
• Click Window -> Hypergraph:Connections.
• Select the nodes you want to examine, then select Graph -> Input and Output Connections.
• Clicking on these nodes will expose the values in the Channel Box editor (right side-bar, main render window). Clicking the connecting lines demonstrate how Maya handles the connections between them.
vvv Everything below this line is guesswork, it has been a decade sense I worked with matrix’s, so take it with a grain of salt. vvv
Now that you can see the data, you just need to convert your row-major (X,Y,Z,T) format into a 4x4 matrix.