Hi, sometimes i use this to avoid the 'Unsaved changes' error #first flush scene with the force flag set mc.file(new=True, force=True)
# now you can open without problems mc.file('path/to/file.ma', o=True) Cheers, Eduardo On Tue, Feb 26, 2013 at 3:04 PM, Justin Israel <justinisr...@gmail.com>wrote: > First check if the scene needs saving: > cmds.file(q=True, modified=True) > > You can also check where it is saved: > cmds.file(q=True, location=True) > > If it is modified, you can use the built-in command to handle all the > logic of saving with dialogs: > # What Maya uses when you choose the File -> Save menu option > cmds.SaveScene() > > > On Feb 26, 2013, at 8:30 PM, Panupat Chongstitwattana wrote: > > I'm getting an error - Runtime Error: Unsaved changes when I try to open a > file via Python command. Is there a way I can make Maya prompt save similar > to when opening files normally? The prompt flag doesn't seem to do it. > > -- > 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 python_inside_maya+unsubscr...@googlegroups.com. > To post to this group, send email to python_inside_maya@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- > 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 python_inside_maya+unsubscr...@googlegroups.com. > To post to this group, send email to python_inside_maya@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- 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 python_inside_maya+unsubscr...@googlegroups.com. To post to this group, send email to python_inside_maya@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.