MEL command that comes with Maya:
*rootOf($obj);*
PyMEL method of dag nodes:
*obj.root()*
*
*
something like this:
from pymel.core import *
objs = ls(sl=1)
for i in objs:
print i.root()
On Thursday, October 11, 2012, Jesse Capper wrote:
> Is there a way to only return selected DAG nodes through maya.cmds? The
> -dag flag of cmds.ls also returns children of any selected DAG nodes
> which isn't what I want. Or is the only option to filter the selection list
> with something like [i for i in cmds.ls(sl=True, l=True) if
> i.startswith('|')] or getting the intersection of cmds.ls(sl=True) and
> cmds.ls(sl=True, dag=True) or something along those lines?
>
> --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings:
> http://groups.google.com/group/python_inside_maya/subscribe
>
--
Sincerely,
Farsheed Ashouri,
ourway.ir
Tel: +98 9388801504
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings:
http://groups.google.com/group/python_inside_maya/subscribe