Maya-Python] get the cmds.intField when button pressed?

14 views
Skip to first unread message
is duplicateview conversation

emmanuelle manue154

unread,
Apr 16, 2017, 5:04:31 PM4/16/17
to python_in...@googlegroups.com

Hello, i need to make an ui layout in python inside maya,
it is asking some questions and when the button is pressed,
put the entries of intField or textField into variables...
very simple but i can't find the solution: "if button pressed?"...
thank you to help me!!

import maya.cmds as cmds
window = cmds.window(title = "Open Last scene", width = 150, height = 100)
cmds.rowColumnLayout( numberOfColumns=2, columnAttach=(1, 'left', 0), columnWidth=[(1, 100), (2, 250)] )
cmds.text( label='Episode:  ', align='left' )
cmds.intField( "Episode", minValue = 0, maxValue = 100, value = 0)
cmds.separator( h=5, style='none' )
cmds.rowColumnLayout( numberOfColumns=1, columnAttach=(1, 'left', 0), columnWidth=[(1, 100), (2, 250)] )
cmds.button('Open', l="Open Last scene", w=180, h=30)
cmds.showWindow()

#if button pressed??
    #put the intField into a variable:
    EpisodeName = `cmds.intField( "Episode", query = True, value = True)`
    print EpisodeName

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages