On 24/10/2014 at 10:17, xxxxxxxx wrote:
Hi,
Any tips on how to prompt the user to save the current document, and then make the saved document the active document?
This is what I'm currently doing:
def main() :
c4d.StopAllThreads()
if is_file_saved(doc) :
print doc.GetDocumentName() + " was saved."
else:
c4d.gui.MessageDialog("This document has not been previously saved, please save it now.")
default_filename = "SHOW_SEQ_Shot01_vA01.c4d"
doc_was_saved = c4d.documents.SaveDocument(doc, default_filename, saveflags=c4d.SAVEDOCUMENTFLAGS_0,
format=c4d.FORMAT_C4DEXPORT)
if doc_was_saved:
print "Document was successfully saved."
else:
print "Document failed to save."
return
This will open up a save dialog, and allow the user to rename the file and save it where they want. However, after the document has been saved, the current document is still named "Untitled 1" or something to that effect. Some questions:
1. How do I save the current file, and ensure that the saved file becomes the working file as opposed to the default "Save As..." / Make-a-copy behavior that seems to be occurring?
2. Assuming #1 isn't possible, how do I retrieve the name/path of the document the user has saved so that I can kill the current doc and load the saved version?
Thanks,
Donovan