Code:
import maya.mel as mel import maya.cmds as cmds scnFilter ="All Scene files (*.ma *.mb);;Ascii Files (*.ma );;Binary Image Files (*.mb);;All Files (*.*)" chosenFile = cmds.fileDialog2(fm=1, ds=0, cap="Open", ff=scnFilter ,okc="Select scene file", hfe=0)
the main() function that has GUI to display and recieve and set info
Code:
import maya.cmds as cmds def main(): window = cmds.window(title='open file') cmds.rowColumnLayout( numberOfColumns=3, columnAttach=(1, 'left', 0), columnWidth=[(1, 100), (2, 250)] ) cmds.text( label='Maya Scene' ) front = cmds.textField() cmds.iconTextButton( style='iconAndTextVertical',align='right',command='scnFileOpen()', image1='fileOpen.xpm', height=8 ) cmds.showWindow( window )