Hi Heather,

It looks like you are selecting the objects instead of listing them.
Try this instead:

pegA=[]
pegA.append(cmds.ls('disc*'))
print pegA

Keep in mind though, that it will return both the transform node and the
shape nodes.
Good news, is that you can specify the type using:

pegA=[]
pegA.append(cmds.ls('disc*',type='transform'))
print pegA

Hope it helps,




--
David Martinez - Technical Animator

Email: [email protected]
Website: http://www.elusiveideas.com




On Thu, May 1, 2014 at 11:11 AM, Heather Rose <[email protected]>wrote:

> Hi guys,
>
> Say I had created 5 discs in my scene, disc0, disc1, disc2, disc3, disc4
>
> I want to select the discs and add the to a list. I tried this out:
>
>     pegA=[]
>     pegA.append(cmds.select('disc*')
>     print pegA
>
> But it didn't work! It printed [None]
>
> Any ideas on how else I could do this?
>
> Thanks guys!
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/e6adc889-906c-46ec-b900-aa9e757691e6%40googlegroups.com<https://groups.google.com/d/msgid/python_inside_maya/e6adc889-906c-46ec-b900-aa9e757691e6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAMLeNpzpxRuCPPJWs4rjudwFEr30fMPojSFw%3Dwbqr_4e6hM9Fw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to