never mind, I got.
I just had to pass te matrix to a MFnMatrixData first and create it.
Cheers

El domingo, 3 de mayo de 2020, 10:48:00 (UTC-7), Rudi Hammad escribió:
>
> 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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/4e3be844-fe3c-431d-bd41-3d492ec2ce2d%40googlegroups.com.

Reply via email to