Oops! Good point!

--
David Martinez - Technical Animator

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




On Thu, May 1, 2014 at 11:28 AM, Marcus Ottosson <[email protected]>wrote:

> cmds.ls() will return a list. If you're looking to add items to an
> existing list, there is a method called .extend:
>
> >>> pegA.extend(cmds.ls(..))
>
> Otherwise, you'll get a list within a list. Inception-style.
>
>
> On 1 May 2014 11:16, David Martinez <[email protected]> wrote:
>
>> 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<https://groups.google.com/d/msgid/python_inside_maya/CAMLeNpzpxRuCPPJWs4rjudwFEr30fMPojSFw%3Dwbqr_4e6hM9Fw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> *Marcus Ottosson*
> [email protected]
>
> --
> 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/CAFRtmOCOWYQGz%2BLvvMuk5LphDXzjKqmbU1DMVaSJ0%2BXDOs_E7Q%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCOWYQGz%2BLvvMuk5LphDXzjKqmbU1DMVaSJ0%2BXDOs_E7Q%40mail.gmail.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/CAMLeNpzjFsROo7yNi0kYFJ2GkXKCXc-jNaWBNLH-CvHeLTM_UA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to