pm.parent doesn't seem to work correctly if passed a list and some of the items in the list are already children of the new parent.
It looks like its casting the list of nodes to a string.
This snippet works in maya 2016 but not in maya 2018
import pymel.core as pm
cubes = []
for x in range(10):
cubes.append(pm.polyCube()[0])
group = pm.group(empty=True)
pm.parent(cubes[:4], group)
pm.parent(cubes, group)
maya 2018 stack trace
# Error: Maya Attribute does not exist (or is not unique):: u"[nt.Transform(u'pCube1'), nt.Transform(u'pCube2'), nt.Transform(u'pCube3'), nt.Transform(u'pCube4'), nt.Transform(u'pCube5'), nt.Transform(u'pCube6'), nt.Transform(u'pCube7'), nt.Transform(u'pCube8'), nt.Transform(u'pCube9'), nt.Transform(u'pCube10')]"
# Traceback (most recent call last):
# File "<maya console>", line 10, in <module>
# File "C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\pymel\core\general.py", line 1391, in parent
# return [PyNode(x) for x in children]
# File "C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\pymel\core\general.py", line 2282, in __new__
# raise _objectError(name)
# MayaAttributeError: Maya Attribute does not exist (or is not unique):: u"[nt.Transform(u'pCube1'), nt.Transform(u'pCube2'), nt.Transform(u'pCube3'), nt.Transform(u'pCube4'), nt.Transform(u'pCube5'), nt.Transform(u'pCube6'), nt.Transform(u'pCube7'), nt.Transform(u'pCube8'), nt.Transform(u'pCube9'), nt.Transform(u'pCube10')]" #
pm.parent doesn't seem to work correctly if passed a list and some of the items in the list are already children of the new parent.
It looks like its casting the list of nodes to a string.
This snippet works in maya 2016 but not in maya 2018
maya 2018 stack trace