Created
June 16, 2014 16:51
-
-
Save gregtemp/2e15801d1f9629c35c88 to your computer and use it in GitHub Desktop.
Learning about windows and stuff - Maya Python Mel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#from here - http://stackoverflow.com/questions/12309634/maya-python-how-to-close-a-custom-ui-window-after-the-user-has-pressed-enter | |
import maya.utils # you need this line! | |
class ReUI(): | |
def __init__(self): | |
renUI = 'renUI' | |
if cmds.window(renUI, exists = True): | |
cmds.deleteUI(renUI) | |
renUI = cmds.window(renUI, t = 'JT Rename UI', sizeable = True, tb = True, mnb = False, mxb = False, menuBar = True, tlb = False, nm = 5) | |
form = cmds.formLayout() | |
rowA = cmds.rowColumnLayout(w = 350, h = 30) | |
item = cmds.ls(os = True)[0] | |
#def ren(): | |
def renFc(self): | |
print 'yes' | |
#tval = cmds.textField(txtA, text = True, q = True) | |
#cmds.rename(item, tval) | |
#maya.utils.executeDeferred("cmds.deleteUI('renUI')") # and this one! | |
def foo(self): | |
print 'noooo' | |
txtA = cmds.textField(w = 345, h = 28, text = item, ec = foo, aie = True) | |
#ren() | |
#maya.utils.executeDeferred("cmds.deleteUI('renUI')") # and this one! | |
cmds.showWindow(renUI) | |
r = ReUI() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment