【问题标题】:Getting the inverse of a matrix with PyMel in Maya 2017在 Maya 2017 中使用 PyMel 获取矩阵的逆
【发布时间】:2018-02-05 12:14:56
【问题描述】:

我一直在查看 PyMel 文档,但无法从 pymel.core.datatypes 中得到矩阵的逆矩阵。我的代码是:

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

我只是得到错误: 错误:第 1 行:AttributeError:文件 S:\Maya_2017_DI\build\Release\runTime\Python\Lib\site-packages\maya\OpenMaya.py 第 54 行:asMatrixInverse #

【问题讨论】:

    标签: python maya matrix-inverse pymel


    【解决方案1】:

    如果 inverseM 已经是一个 pymel 矩阵,则需要 inverseM.inverse()。文档是here。其实是the same thing for an OpenMaya MMatrix too

    【讨论】:

    • 嗨,你说得对。我正在使用 TransformationMatrices,当我在其中使用 asInverseMatrix() 时,我得到了一个普通的矩阵。当我将矩阵与其他 TransformationMatricies 相乘时,它们也变成了普通矩阵,然后我不能使用 asMatrixInverse() 因为它们不再是 TransformationMatricies。
    猜你喜欢
    • 2018-05-04
    • 2022-06-30
    • 1970-01-01
    • 2014-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多