You! Always pleasant to find you on a random forum from a 2014 post. Ha. 

Hope you and the fam. are doing well.

On Thursday, 6 February 2014 at 17:24:47 UTC-8 Geordie Martinez wrote:

> try this. you were passing a list which is what getChildren gives you. 
> in this case you're getting the shape node (not a list). Hope this helps!
>
>
> import pymel.core as pm
> node = pm.circle()[0]
> curves = node.getShape() 
> newCurves = pm.duplicate(curves, addShape=True)
>
>
>
> On Thu, Feb 6, 2014 at 10:45 AM, Mikkel Caiafa <
> mca...@bossfightentertainment.com> wrote:
>
>> 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.
>>
>
>

-- 
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/c4729397-1f4f-40c4-87fd-d26a31bf1638n%40googlegroups.com.

Reply via email to