Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Maya UI Question

1 REPLY 1
Reply
Message 1 of 2
George.Xyooj
265 Views, 1 Reply

Maya UI Question

Long story short, I loaded up a simple UI and then close it using deleteUI().  Try relaunching and this error occurs:  

# Error: RuntimeError: Object's name 'newtab' is not unique. # 

 

 

Here is the simple code I'm using.  

 

import maya.cmds as mc

 

workspaceName = 'newtab'

if mc.workspaceControlState(workspaceName, exists=True):
    mc.deleteUI(workspaceName)

 

def buildContent():
    WinLayout = mc.columnLayout( adjustableColumn=True )
    mc.button( label='Do Nothing' )
    mc.button( label='Close', command=('mc.deleteUI(\"' + workspaceName + '\" )') )

mc.workspaceControl(workspaceName, uiScript = 'buildContent()', ttc=["Outliner",0])

 

 

 Either there is a different way of doing this or I don't know how to use the workspacecontrolstate() and deleteUI().

1 REPLY 1
Message 2 of 2
jdrese
in reply to: George.Xyooj

Hello

 

I think you have to use the close flag under the workspaceControl command as well when deleting your UI.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report