Pymel fileDialog2, fileBrowserDialog, promptForPath, promptForFolder woes

Anyone want to venture a guess as to why this is happening? Some file dialogs work while others don’t. It’s a new installation of pymel and windows 7 64-bit and no other problems with pymel so far. I’m not trying to use all of these, just tried to test them all since the one I want, promptForPath(), doesn’t work.


pm.promptForPath()
# Error: Maya command error
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
#   File "c:\program files (x86)\autodesk\maya2009\python\lib\site-packages\pymel-1.0.0-py2.5.egg\pymel\core\windows.py", line 368, in promptForPath
#     ret = cmds.fileBrowserDialog(**kwargs)
#   File "c:\program files (x86)\autodesk\maya2009\python\lib\site-packages\pymel-1.0.0-py2.5.egg\pymel\internal\pmcmds.py", line 98, in wrappedCmd
#     res = new_cmd(*new_args, **new_kwargs)
# RuntimeError: Maya command error # 

:curses:


pm.promptForFolder()

:):


pm.fileDialog()

:):


pm.fileDialog2()
# Error: 'module' object has no attribute 'fileDialog2'
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
# AttributeError: 'module' object has no attribute 'fileDialog2' # 

:curses:


pm.fileBrowserDialog()
# Error: Maya command error
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
#   File "c:\program files (x86)\autodesk\maya2009\python\lib\site-packages\pymel-1.0.0-py2.5.egg\pymel\internal\factories.py", line 639, in newUiFunc
#     return beforeUiFunc(*args, **kwargs)
#   File "c:\program files (x86)\autodesk\maya2009\python\lib\site-packages\pymel-1.0.0-py2.5.egg\pymel\internal\pmcmds.py", line 98, in wrappedCmd
#     res = new_cmd(*new_args, **new_kwargs)
# RuntimeError: Maya command error # 

:curses:

:sigh:

Looking at the pymel docs, promptForFolder is part of pymel.core.windows, not just pymel.core.

So therefore, you can use:


import pymel.core as pm
pm.windows.promptForFolder()

Worked for me on windows 7, maya 2011 64 bit anyway!

Similarly, fileDialog2 is found here:
pymel.core.system.fileDialog2

There may be better ways to import and use these modules though? I’m quite new to pymel…

Yeah, that works. I didn’t have problems with promptForFolder(), but with promptForPath(). Also, fileDialog2(). Why isn’t this better in the docs I wonder? Tried it out on my computer at home. Same problem. I’m trying some things including getting latest from github. Google wasn’t any help this time either.

The gods are against me, mayapy.exe is crashing when trying to reinstall pymel, git or not. That’s my cue to hit the hay.

Most of that stuff is Maya 2011 and up. They were written for the QT dialogs.

Ok, thankyou count. I will get around to working more in 2011 one of these days! After this project is done it’ll be so long 2009.

my bad, i mismatched your smileys/frownies to the code…