Why is Maya complaining about this:
from maya.api.OpenMaya import MTransformationMatrix, MGlobal, MSelectionList, MFnDagNode, MFnTransform
from maya.api.OpenMaya import MTransformationMatrix, MGlobal, MSelectionList, MFnDagNode, MFnTransform
sel = MGlobal.getActiveSelectionList() # selection
dagpath = sel.getDependNode(0) # first node
transform_node = MFnTransform(dagpath) # MFnTransform
xfm= trans.transformation().asMatrix() # matrix
new_matrix = some_other_matrix * xfm # maath
new_trans = MTransformationMatrix(new_matrix)
transform_node.setTransformation(new_trans)
This complains
# Error: TypeError: file <maya console> line 8: MTransformationMatrix required. #
But new_trans
clearly is an MTransformationMatrix. What gives? I am testing this on a beta maya – is that it? Does this work for others?