decomposeMatrix plugin

In a standard maya package (at least since 8.5) there’s plugin with a rather foggy for a lot of people name decomposeMatrix. This plugin adds a pretty useful node with the same title that could be used to convert standard 4×4 transform matrix to translation, rotation, scale and shear.

decomposeMatrix Interface

decomposeMatrix Interface

Practical usage – to have a node in a setup of some kind that returns world space values of object’s transformations via plugging it’s worldMatrix into this node. Generally, the result is identical to using parentConstraint + scaleConstraint, but calculations speed doesn’t drop with depth of hierarchy above this object (as it does with constraints), setup is a bit simpler and everything is done via single node.

decomposeMatrix plugin loaded

To use it make sure that decomposeMatrix.mll plugin is loaded in Plug-in Manager:

decomposeMatrix network

decomposeMatrix network

and create this node with a command:

createNode decomposeMatrix;

Additional trick – you can plug matrices of different objects through choice node into decomposeMatrix to switch between them:

decomposeMatrix with choice plugged in

decomposeMatrix with choice plugged in

P.S. If you need just world space coordinates of the object – without rotate and scale – the most efficient node to use is pointMatrixMult:

pointMatrixMult generates locator's coordinates in world space

pointMatrixMult generates locator's coordinates in world space

4 Responses to “decomposeMatrix plugin”

  1. matt - September 4, 2009

    once again great info! never knew about that and that’s very usefull

  2. jayster - September 7, 2009

    Hello,

    Do you know if ‘decomposeMatrix’ can be used to extract a non-flipping ‘Y’ rotation from a path animated object?

    Cheers,

    j.

  3. Sagroth - September 8, 2009

    I’m not sure about that. It just translates matrix into TRS values, the same thing that maya does. If there’s a flip it should flip after decomposeMatrix also. But it won’t hurt to try anyway :)

  4. SomeSanctus - October 15, 2009

    спасибо огромное, сегодня очень пригодилось!

Leave a Reply