View Full Version : Get children of a Panel?

05 May 2012, 04:52 PM
I am at a loss on how to find the children or layout of a Panel.
The Layout command has flags for retrieving the children, but the various 'Panel' and 'Editor' commands don't seem to offer the same functionality.

I am trying to work out the name of an editor, given the results from:

animCurvePanel = cmds.getPanel(scriptType='graphEditor')
# Result: [u'graphEditor1'] #

From 'graphEditor1' i want to derive the name of the actual editor (which by default is 'graphEditor1GraphEd', but I hate making assumptions)

If I assume I already know the name of the editor, I can get the full path to the editor with:

cmds.animCurveEditor('graphEditor1GraphEd', query=True, control=True)
# Result: graphEditor1Window|TearOffPane|graphEditor1|formLayout55|paneLayout2|graphEditor1GraphEd #

My question is, how can i get 'formLayout55' from 'graphEditor' so I ca walk down the UI to the Graph Editor?

Thanks. Seems simple and I feel like I'm missing something super obvious...

05 May 2012, 04:55 PM
I found an answer after posting... it was simple and obvious...

Turns out I can use the generic 'layout' command on panels

cmds.layout('graphEditor1', query=True, childArray=True)
# Result: [u'formLayout55'] #

06 June 2012, 02:11 PM
I know this is a little late. But in PyMEL, you could do it this way:

mainLayout = columnLayout()
layoutChildren = mainLayout.getChildArray()
# Result: [u'columnLayout12', u'columnLayout13', u'rowColumnLayout4'] #

CGTalk Moderation
06 June 2012, 02:11 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.