Do you mean you just want to get the parent of each item from your ls command?
You can pass the geometry results from the ls -> listRelatives

cmds.listRelatives(cmds.ls(geometry=True, l=True), parent=True, f=True)

That should return the parent of each item from the ls command.



On Thu, Aug 30, 2012 at 2:13 PM, GWinters <[email protected]> wrote:
> Hi everyone!
> Im starting to write scripts in python within maya and Im running into an
> issue. Im trying to get the list to select the top dependency node of all
> geometry in the scene.  I get this list by having the list focus on the
> transforms but that is also pulling in transforms in on the cameras and
> lights.  I want it to run execute similarly to selecting geometry in
> outliner and duplicating it.  As of right now I have a list of all the
> geometry
>
> allMeshes2 = cmds.ls(geometry=True)
>
> Then in the for loop I have a pickWalk before duplicating it.
> cmds.pickWalk(direction= "up")
>
> Is there anyway to just have the ls select that object from the outliner?
> Thanks!
>
> Glenn
>
> --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings:
> http://groups.google.com/group/python_inside_maya/subscribe

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to