OpenMaya MFnTransform setScale() issue

9 views
Skip to first unread message

Rudi Hammad

unread,
Jul 16, 2021, 9:09:23 AMJul 16
to Python Programming for Autodesk Maya

Hello,
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.

thoughts?

R


Marcus Ottosson

unread,
Jul 16, 2021, 9:33:21 AMJul 16
to python_in...@googlegroups.com
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/a949f734-dd9b-4eb9-a1cc-ce9b36748319n%40googlegroups.com.

Rudi Hammad

unread,
Jul 16, 2021, 9:55:48 AMJul 16
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.
Thanks

R
Reply all
Reply to author
Forward
0 new messages