How do you read individual elements in an MMatrix object in Maya Python? This is a problem that Ryan and I ran into about a year or so ago. Ryan brought this to the attention of an Autodesk developer at the time, who must have been misinformed and told us that it should work like C++. However, the following does not work:
# Create an MMatrix and print its first index
import maya.OpenMaya as OM
mat = OM.MMatrix()
print mat.matrix[0][0]
I was at Autodesk’s Maya API training last week during the GDC, and one of the trainers had run into this problem again. Unfortunately, she had also been misinformed by one of the developers as to how this should work. (more…)
