If you take a look at the docs for the select() command, you will see that
it reports it has no return value :
http://help.autodesk.com/cloudhelp/2016/ENU/Maya-Tech-Docs/CommandsPython/select.html

The following code is getting a None return value from the select() call:

result = cmds.select( cmds.listRelatives(cmds.ls(selection=True),
children=True))

You are passing the results of listRelatives() to select(), which is what
you wanted, but if you also want to print that return value then you want
to capture it to a variable first:

result = cmds.listRelatives(cmds.ls(selection=True), children=True)
print result
cmds.select(result)

On Thu, Aug 31, 2017, 7:16 AM jettam <[email protected]> wrote:

> I found if I just removed a lot of that in bracket stuff then I was able
> to print the result.  The more complicated version I found online. Still
> not sure why it didn't print in the first place.
>
> cmds.select( instanceGroup )
> result =  cmds.listRelatives()
> print result
>
> On Wednesday, August 30, 2017 at 11:48:45 AM UTC-7, jettam wrote:
>>
>> The script below selects all objects found in a group. But, for some
>> reason it doesn't want to print the result. Could someone explain why it
>> doesn't print the result ?
>>
>> cmds.select( instanceGroup )
>> result = cmds.select( cmds.listRelatives(cmds.ls(selection=True),
>> children=True))
>> print result
>>
> --
> 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/f56a8442-0955-4861-9c69-e437801cd2e5%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/f56a8442-0955-4861-9c69-e437801cd2e5%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/CAPGFgA3ZwQmj%2BeVR4CR%3Dbwbjif65uqqf%3DFqEN5rUg2nBBXzfjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to