I am trying to get the (user chosen) directory path from a browse
function, but I keep getting a syntax error.  This technique works
perfectly in MEL but throws a syntax error in python.  Is this a bug,
or is there a better way of doing this in python

Thanks
Jared

[code]

import maya.cmds as cmds
win = "myWindow"
def dirPath(filePath, fileType):
    cmds.textFieldButtonGrp('Dir', edit=True, text=str(filePath))
    return 1
def gui():
    #Creates the window.
    if(cmds.window(win, q=1, ex=1)):
        cmds.deleteUI(win)
    if(cmds.windowPref(win, q=1, ex=1)):
        cmds.windowPref(win, r=1)

    cmds.window(win, t="Test Window", w=350, h=150)
    cmds.columnLayout("colLyt")
    cmds.textFieldButtonGrp('Dir',label='Directory Path', text='Browse
for Directory', buttonLabel='browse', buttonCommand=browseIt)
    cmds.showWindow(win)
def browseIt():
    cmds.fileBrowserDialog( m=4, fc=dirPath, ft='directory',
an='Choose Directory')
    return
gui()

[/code]
--~--~---------~--~----~------------~-------~--~----~
Yours,
Maya-Python Club Team.
-~----------~----~----~----~------~----~------~--~---

Reply via email to