PDA

View Full Version : Parenting scripted panels [Python]


Koochy
07-02-2012, 11:14 AM
I'd like to make a new window in Python and parent the UV editor under a new layout. I've seen it be done with other scripted panels like the graph editor... but I can't seem to figure it out with the UV editor. I'm using Maya 2012.

Please help!

djx
07-02-2012, 12:19 PM
This is how it is being done in Erik Spellerberg's excellent UV Delux (http://www.creativecrash.com/maya/downloads/scripts-plugins/texturing/c/uvdeluxe)
cmds.window('UVDeluxe', s=True, width=440, title='UVDeluxe')
pane = cmds.paneLayout('textureEditorPanel', paneSize=[1,22,1], cn='vertical2')
uvTextureViews = cmds.getPanel(scriptType='polyTexturePlacementPanel')

if len(uvTextureViews):
cmds.scriptedPanel(uvTextureViews[0], e=True, unParent=True)

cmds.scriptedPanel(uvTextureViews[0], e=True, parent=pane)
cmds.showWindow('UVDeluxe')
cmds.window('UVDeluxe',edit=True,width=1000)

David

edit: I've tried about 8 times to get this code entered with correct indentation and without extra spaces. Giving up now. :shrug:I'm sure you'll figure it out. Or you can get the original source from creativeCrash.

Koochy
07-02-2012, 09:38 PM
You legend! Got it loaded up and functioning. Thank you very much! :D

I should note, that:
(scriptType='polyTexturePlacementPane l')
... was causing a problem, note the 'pane l'. This is just forum formatting issue if anyone else stumbles across this thread in the future.

CGTalk Moderation
07-02-2012, 09:38 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.