Ok, I realized that I had to give the element 0 because it is an array. So 
with this I don't get any errors now:

matList = [18,     24,    7,    0,
           54,    17,    1,    0,
           22,    34,    8,    0,
           11,    78,    6,    1]
mScr = OpenMaya.MScriptUtil()
MMat =  OpenMaya.MMatrix()
mScr.createMatrixFromList(matList, MMat)


cmds.joint(n="myJoint")

mslist = OpenMaya.MSelectionList()
mslist.add("myJoint")
mobj = OpenMaya.MObject()
mslist.getDependNode(0, mobj)
mfndepnode = OpenMaya.MFnDependencyNode(mobj)

mfndepnode = OpenMaya.MFnDependencyNode(mobj)
matPlug = mfndepnode.findPlug("worldMatrix")
matPlug_ind0 = matPlug.elementByLogicalIndex(0)

mfnMatData = OpenMaya.MFnMatrixData(matPlug_ind0.asMObject())

mfnMatData.set(MMat)  # No errors, but nothing is happening

..but still, the method .set() is not doing anything. Not sure why...

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/801716ee-b73a-4a38-a241-582894536140%40googlegroups.com.

Reply via email to