View Full Version : 4x4MatrixToTRS Python API plugin

02-03-2009, 09:06 PM
Hey guys,

I released a Python API plug-in utility node which allows you to connect 16 separate float values which are converted into a matrix then output as translate, rotate, and scale. The node also has a parentInverse matrix input value and translate, rotate, and scale offset values. The Python source code is included and I have attempted to comment it well so it can be learned from. The file also includes an example .ma file for you to see a basic example of something you could do with it. It should work with all versions of maya that have Python built into it. You can download the plugin here:


All comments and suggestions are welcome.


02-03-2009, 09:21 PM
Haven't had a chance to browse the source yet, but thanks for sharing Ryan, I think I'll find this very useful!

02-04-2009, 02:19 PM
cool thanks for sharing !
From what you wrote I assume it's something like decomposeMatrix plugin but with offsets and parentInverseMatrix input ? I`ll check it tonight though.

02-04-2009, 04:50 PM
Yes the node is similar to a combination of a decomposeMatrix node and a FourByFourFloatMatrix node with the offsets and parentInverse matrix inputs as well. I also added a normalize for the input of the first three vectors of the matrix. So the scale will always stay normalized but it still can become non uniform.

02-04-2009, 04:52 PM
very nice....and your site is very helpful too...the material is clear and nicely presented.
In, maya 2009 I did have a problem loading the scene file....I had to edit out the lines listed in the error below......
// Error: file: C:/Downloads/Maya/rt4x4MatrixToTRS/rt4x4MatrixToTRS_example.ma line 824: Cannot find procedure "relationship". //
And none of the child names made it thru to the AE...all 16 attributes have the same name....... matrix In....the parent name.....that seemed odd in this particular case, but it is clearly typical.

02-04-2009, 06:11 PM
Sorry about that tbaypaul. I reloaded the example file in Maya 2008 and fixed the issues and re-saved it. If you re-download the file you will get the new example file. The script will work fine either way. It was just the .ma file was messed up.

02-05-2009, 08:08 AM
I checked it out! Thanks again Ryan, I will use it! And very well written as well :)

CGTalk Moderation
02-05-2009, 08:08 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.