If you're using PySide, I'd be on the side of using QFileDialog. It's a really simple setup with a convenience call (static function):

fileName = QtGui.QFileDialog.getSaveFileName(self, "Save File As",
                                             "C:/", "FBX Files (*.fbx)")

While you CAN integrate fileDialog2 in PySide, it's a lot of extra work, for no real gain. Honestly, when I've been trying to throw something together quickly, I've been more likely to call QFileDialog from my Maya UI. It's a separate window, so in the end it makes no real difference, besides which library you bring in.

On 6/4/2015 5:36 AM, Panupat Chongstitwattana wrote:
If I use PySide as my main UI, can I fire up cmds.fileDialog2 instead of QtGui.QFileDialog and send the result back to PySide UI? What's the advantage of each you think?


On Thursday, June 4, 2015 at 12:49:42 PM UTC+7, Joe Weidenbach wrote:

    You will basically need to come up with a desired UI layout.  For
    a file dialog, you could do something similar to this:

    import os.path

    import maya.cmds as cmds

    homeDir = os.path.expanduser("~")

    filter = "Jpeg Images (*.jpg)"
    filePath = cmds.fileDialog2(cap="Choose File Save Directory",
    startingDirectory=homeDir,
            fileFilter=filter, fileMode=0)
    print filePath[0]

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f5178341-c8fc-420d-b5f2-dfad00e1a556%40googlegroups.com <https://groups.google.com/d/msgid/python_inside_maya/f5178341-c8fc-420d-b5f2-dfad00e1a556%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.



---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
https://www.avast.com/antivirus

--
You received this message because you are subscribed to the Google Groups "Python 
Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/5570908D.4060501%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to