|04 April 2013||#1|
Join Date: Mar 2013
UI in Python, New window everytime I run script ??? :(
Okay, title is pretty bad but i'll try to explain my problem...
I have created a UI in Maya Python for my code, Every time I run my entire code with the UI integrated, another UI pops up, is there any way I can set a command that deletes the previous UI and basically refreshes it, rather then it keep opening a fresh window each time I run?
I believe it has something to do with this command...
if (cmds.window("Domino Effect", exists=True)):
The start of my UI currently like this...
win = window( title="Domino Effect", iconName="D'Effect", w = 300, h = 300, )
layout = columnLayout()
btn1 = button( label="Gravity", command='buttonPressed()' )
btn2 = button( label="RigidBody(Ground)", command='rigidBody()' )
btn3 = button( label="Duplicate Objects", command='duplicateObj()' )
..... So my basic question is, does anyone know how I can set my code so it doesn't open a NEW window everytime I open it, instead it will just REFRESH the current one?
Thanks for any tips and tricks... If someone knows the command for this, and where I should place this command, i'd be forever grateful
|04 April 2013||#3|
Senior Technical Artist
Join Date: Jul 2002
Your method is correct, however your syntax is not. It seems like you're using a mix of python and pymel.
Your main problem is you're not giving your window a unique identifier.
Full Fix below.
|Thread Closed share thread|