OpenMaya MFnTransform setScale() issue

Skip to first unread message

Rudi Hammad

Jul 16, 2021, 9:09:23 AM7/16/21
to Python Programming for Autodesk Maya

I am trying to set the scale with OpenMaya and for some reason, it is setting the
wrong axis. Here is the code:

What I am doing is creating 2 locators, setting one of them  to -1 in scaleY, getting the matrix, and then from that matrix extracting the scale and set that scale to the other locator. But for some reason that I don't get, the scale set is no the scaleY , but the scaleZ.



Marcus Ottosson

Jul 16, 2021, 9:33:21 AM7/16/21
A matrix cannot accurately represent a negative scale along an arbitrary axis. The information along which axis you scale is lost during the conversion from transform into a matrix. The resulting worldspace matrix will be correct, but they may have different decomposed scale (and rotate) values.

You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Rudi Hammad

Jul 16, 2021, 9:55:48 AM7/16/21
to Python Programming for Autodesk Maya
hmmm..ok, i see.
Yes, the matrices matched each other , but the scaled axes didn't match. What ever I tried, during the conversation it was alway the scaleZ set to -1.

Reply all
Reply to author
0 new messages