CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
Thread Tools Search this Thread Display Modes
Old 06-27-2013, 03:04 PM   #1
New Member
Join Date: Sep 2009
Posts: 23
delete modelPanel python


I've a problem.When i run the code below, it's work. But when i close the window and then reload this code i have an error :
# Error: RuntimeError: file <maya console> line 8: Object's name 'B' is not unique. #
if (cmds.window("A", exists=True)): cmds.deleteUI("A") window = cmds.window("A") cmds.paneLayout() cmds.modelPanel("B") cmds.showWindow( window )

When i try to remove modelPanel maya crash:
if (cmds.window("A", exists=True)): cmds.deleteUI("A") if (cmds.modelPanel("B", exists=True)): cmds.deleteUI("B") window = cmds.window("A") cmds.paneLayout() cmds.modelPanel("B") cmds.showWindow( window )

Someone have an idea?

Thanks in advance
Old 06-28-2013, 02:40 PM   #2
Where's my pony?
djx's Avatar
David Johnson
vfx & creature td
Melbourne, Australia
Join Date: Jun 2003
Posts: 3,571
Use panel=True when deleting the modelPanel
if (cmds.window("A", exists=True)): cmds.deleteUI("A") if (cmds.modelPanel("B", exists=True)): cmds.deleteUI("B", panel=True) WIN = cmds.window("A") cmds.paneLayout() cmds.modelPanel("B") cmds.showWindow( WIN )


I've revised my original answer, because I realized it was not really answering your question and creating and leaving behind unnamed panels. The actual answer to youq question should have been... use the panel=True keyword in the deleteUI function.
Sorry for the confusion.

Last edited by djx : 06-28-2013 at 03:11 PM.
Old 06-28-2013, 02:40 PM   #3
CGTalk Moderation
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 11:49 AM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.