Hello all,
I noticed this in the pymel docs for the duplicate command:
Modifications:
· new option: addShape
If addShape evaluates to True, then all arguments fed in must be shapes, and each will be duplicated and added under the existing parent transform, instead of duplicating the parent transform. The following arguments are incompatible with addShape, and will raise a ValueError if enabled along with addShape:
renameChildren (rc), instanceLeaf (ilf), parentOnly (po), smartTransform (st)
Decided to try it out but I’m getting an error. Any ideas what I’m doing wrong?
node = pm.circle()[0]
curves = node.getChildren(type='nurbsCurve')
newCurves = pm.duplicate(curves, addShape=True)
# Error: Maya Attribute does not exist: u"[nt.NurbsCurve(u'nurbsCircleShape1')]"
# Traceback (most recent call last):
# File "<maya console>", line 1, in <module>
# File "C:\Program Files\Autodesk\Maya2014\Python\lib\site-packages\pymel\core\general.py", line 1265, in duplicate
# for origShape in [PyNode(x) for x in args]:
# File "C:\Program Files\Autodesk\Maya2014\Python\lib\site-packages\pymel\core\general.py", line 1787, in __new__
# raise _objectError( name )
# MayaAttributeError: Maya Attribute does not exist: u"[nt.NurbsCurve(u'nurbsCircleShape1')]" #
Thanks!
-Mikkel.
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/bc286db7ae354cf2a6cfa4c54f7840ac%40CO1PR05MB362.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/groups/opt_out.
node = pm.circle()[0]
curves = node.getChildren(type='nurbsCurve')
newCurves = pm.duplicate(*curves, addShape=True)
Cheers!
-Mikkel.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/e384db6acf7d419a8d62aeb1bc2dae75%40CO1PR05MB362.namprd05.prod.outlook.com.