Pymel setMatrix()?

No matter what I do it just simply won’t work. setTranslation, setRotation and setScale works easily. Also getMatrix works, but setMatrix always gives some error:


newNode.setMatrix( oldNode.getMatrix() )
# Error: TypeError: setMatrix() takes exactly 2 non-keyword arguments (1 given) # 

newNode.setMatrix ( True, oldNode.getMatrix() )
# Error: TypeError: wrappedMelFunc() takes at most 2 arguments (3 given) # 

newNode.setMatrix (val = "wolrdSpace", oldNode.getMatrix())
# Error: SyntaxError: non-keyword arg after keyword arg # 

newNode.setMatrix (oldNode.getMatrix(), val = "wolrdSpace" )
# Error: TypeError: wrappedMelFunc() got multiple values for keyword argument 'val' #

newNode.setMatrix (oldNode.getMatrix(), p="wolrdSpace" )
# Error: TypeError: setMatrix() takes exactly 2 non-keyword arguments (1 given) # 

newNode.setMatrix (oldNode.getMatrix(), "wolrdSpace" )
# Error: TypeError: wrappedMelFunc() takes at most 2 arguments (3 given) # 

I’ve found this issue assigned as fixed in 23rd january. Since Maya 2011 was released before that, I would probably get setMatrix working only if I install pymel again manually, right?

You can either install the latest PyMel, or you can patch the related file(s). Note that the newest version of PyMel is fairly different that the one that comes with Maya, and you will likely need to alter your scripts to support the new import format. Also, getting Maya to use the new version and not the old version is problematic. It may be easier to patch the files changed in the thread you linked to.

Mmmmmm… Thanks. I think I will try to just patch the files I need first.