[maya python api] operator =

What’s the syntax for using operators, in the Maya Python api?

From the docs (MEulerRotation Class Reference):

MEulerRotation & operator= (const MMatrix &m)
Convert the given 4X4 homogeneous rotation matrix to a euler rotation.

I have a matrix, and want to convert it to a euler rotation, but doing this doesn’t work:

euler = om.MEulerRotation()
euler = some_matrix_already_defined

It just assigns the matrix to the euler variable, and doesn’t invoke the “operator =”.

What am I missing?

Ok, pymel has EulerRotation.decompose(Matrix, rotation_order) function. That might work!

Still curious about the operator syntax though.

= is not an operator in python and it cannot be overloaded.

lies!

:frowning:

Thanks