1

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 #

Hamaro
  • 49
  • 9

1 Answers1

1

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

theodox
  • 12,028
  • 3
  • 23
  • 36
  • Hi, you were kinda right. I was using TransformationMatrices and when i used asInverseMatrix() on one i got a plain Matrix back. When i multiplied the Matrix with the other TransformationMatricies they turned into plain Matricies too and then later on i couldn't use asMatrixInverse() because they were not TransformationMatricies anymore. – Hamaro Feb 08 '18 at 22:52