Hamaro
Hamaro

Reputation: 49

Getting the inverse of a matrix with PyMel in Maya 2017

I've been looking around in the PyMel docs but can't I get the inverse of a matrix from pymel.core.datatypes. My code is:

inverseM = orientationM*bindRotationM;
inverseM = inverseM.asMatrixInverse()

I just get the error: Error: line 1: AttributeError: file S:\Maya_2017_DI\build\Release\runTime\Python\Lib\site-packages\maya\OpenMaya.py line 54: asMatrixInverse #

Upvotes: 1

Views: 679

Answers (1)

theodox
theodox

Reputation: 12218

if inverseM is already a pymel matrix, you want inverseM.inverse(). The doc is here. Actually its the same thing for an OpenMaya MMatrix too

Upvotes: 1

Related Questions