Also, a more direct way of querying if an object is a specific type of node
is:

cmds.objectType(myNode, isAType='transform')

...which will return True for all transforms and joints (which inherit from
transforms), for instance.

Using cmds.nodeType(myNode, inherited=True) has the added bonus of helping
you learn the inheritance hiearchy, though...


On Fri, May 23, 2014 at 2:24 AM, Marcus Ottosson <[email protected]>wrote:

> Gah! Of course thanks again Marcus :)
>
> You’re welcome. :)
> ​
>
>
> On 23 May 2014 08:20, Arjun Thekkummadathil <[email protected]> wrote:
>
>> if you say
>> ls -dag
>>
>> it will list only dag objects
>>
>>
>> On Fri, May 23, 2014 at 12:40 PM, Jeremy YeoKhoo <[email protected]>wrote:
>>
>>> Gah! Of course thanks again Marcus :)
>>>
>>> On Friday, 23 May 2014 14:38:39 UTC+10, Jeremy YeoKhoo wrote:
>>>>
>>>> (Sorry I posted this up before but tried to edit it.)
>>>>
>>>>
>>>> Hi guys,
>>>>
>>>> This is a bit silly. But...
>>>> I am trying to determine if a queried object is a dag node or a shape
>>>> node because my current example code has the following....
>>>>
>>>> import maya.cmds as cmds
>>>>
>>>> obj= cmds.polySphere(r= 1, sx= 20, sy= 20, ax=[0, 1, 0], cuv= 2, ch= 0)
>>>> cmds.select(obj, r=1)
>>>> sels= cmds.ls(sl=1)
>>>> result= cmds.listRelatives(sels[0],c=1, s=0)
>>>>
>>>> within result, I still get a shape object in the list....
>>>> So the way I check if it is a DAG node, I would then
>>>>
>>>> for r in result:
>>>>     if cmds.objExists(r+"tx"):
>>>>        print "This is daggy"
>>>>
>>>>
>>>> Is there a better way of coding this?
>>>>
>>>> -Jeremy
>>>>
>>>  --
>>> 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/3aa1bb9a-7d38-46ab-8c02-1d3e864a59d6%40googlegroups.com<https://groups.google.com/d/msgid/python_inside_maya/3aa1bb9a-7d38-46ab-8c02-1d3e864a59d6%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/CAJrOGy_kN40P%3DGzGG%2BTbgtEOeCZxODn2BRageuNykPdFcrZwAQ%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAJrOGy_kN40P%3DGzGG%2BTbgtEOeCZxODn2BRageuNykPdFcrZwAQ%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/CAFRtmOA2FD_K70Fuc-V5ofPjAB1_AOkXfUOGOb9SoMJdt9-Zng%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOA2FD_K70Fuc-V5ofPjAB1_AOkXfUOGOb9SoMJdt9-Zng%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/CAAssL7YsSz_tGu82%2BrnR1zmXdDh9R8CNW7mu84q8f9BiLJ0stg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to