LumaPictures / pymel

Python in Maya Done Right
Other
479 stars 130 forks source link

core.deformer(pyNode, edit=1) doesn't work #351

Open pmolodo opened 8 years ago

pmolodo commented 8 years ago

From gaspou...@gmail.com on March 03, 2015 11:47:06

When using the core.deformer in edit mode (in order to prune for example), pymel returns an error:

Error: argument 2 to map() must support iteration

Traceback (most recent call last):

File "", line 1, in

File "/software/apps/Linux/Autodesk/Maya/2015SP5/maya2015-x64/lib/python2.7/site-packages/pymel/core/animation.py", line 50, in deformer

return map( _general.PyNode, cmds.deformer(_args, *_kwargs) )

TypeError: argument 2 to map() must support iteration

I'm using Maya 2015 Extension 1 + SP5 for Linux

I'm on CentOS6.5 64bit

Using Pymel 1.0.6 What is the expected output? What do you see instead? I guess the expected output would be the deformer node. Instead I have an error message.

Here's a code that reproduces the problem: from pymel import core sphere1 = core.polySphere(r=1)[0](clusterDeformer, clusterHandle) = core.cluster(sphere1.getShape()) core.deformer(clusterDeformer, e=1, pr=1) Does maya.cmds exhibit the same problem? maya.cmds works, but returns None, creating the error when mapping. Please provide any additional information below. I quickly looked into animation.py and found out that cmds.deformer() always return None on edit, and the map() method in core.deformer() doesn't like this. Other methods use _util.listForNone() in order to avoid this problem, and it's not the case here.

Original issue: http://code.google.com/p/pymel/issues/detail?id=318