delete modelPanel python

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 06 June 2013   #1
delete modelPanel python

Hello,

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 June 2013   #2
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 )


David

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.
__________________
http://www.djx.com.au

Last edited by djx : 06 June 2013 at 03:11 PM.
 
Old 06 June 2013   #3
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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 07:02 AM.


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