Hello Likage, Be aware that the fileDialog2 command only gets a filename(or filenames) then you need to rename the scene, and save it.
I dont have maya around to check it out, but it should be something like this import maya.cmds as cmds name = cmds.fileDialog2(ds=2, fileFilter="Maya Ascii (*.ma)") #not sure if fileDialog2 returns a single name or a list, # in case it's a list use name[0] cmds.file( rename=name ) cmds.file( save=True, type='mayaAscii' ) Cheers, Eduardo On Wed, Dec 24, 2014 at 1:05 AM, likage <[email protected]> wrote: > I have looked at the list of maya commands available but I am unable to > find any dialogs that are similar to 'Save Scene as' and I chanced upon > fileDialog and fileDialog2. > > I can try using mel.eval('SaveSceneAs') but it does seems like a practical > approach, maybe? And so, I am going to use fileDialog2 since it is > mentioned that fileDialog is going to be deprecated but as I tried it out > import maya.cmds as cmds > cmds.fileDialog2(ds=2, fileFilter="Maya Ascii (*.ma)") > > my scene file was not saved at all. Am I doing it wrong somewhere? > > Additonally, was wondering, if it is possible to prompt a popup window > (like a Ok/Cancel), if user clicks on OK, the fileDialog2 will appears for > them to save the file etc.. > > -- > 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/406df031-b91e-429a-944e-7ddc189e3287%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/406df031-b91e-429a-944e-7ddc189e3287%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Eduardo GraƱa www.eduardograna.com.ar -- 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/CACt6GrneBN6kYgqM76Xb5MDOMPJ7ZLdTj%2BuO0HF___TPgBfX1Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
