Saving files without the File Browser?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 29/06/2011 at 08:59, xxxxxxxx wrote:

********Is there a way to save the .c4d scene without that File Browser popping up?
In Coffee. This code will do that:  doc->Save(SceneName);
But I can't find anything like that in the Python docs.

Using: c4d.documents.SaveDocument(doc, path, flags, c4d.FORMAT_C4DEXPORT) always results in the File Browser popping up. No matter what flags I use.

I found this in the docs: c4d.plugins.SceneSaverData
But it's rather vague and says: "Use RegisterSceneSaverPlugin to register the plugin.

Does that mean that saving without the file Browser popping up can only be done with a full blown, registered plugin?
That doesn't seem right.

-ScottA

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 29/06/2011 at 09:41, xxxxxxxx wrote:

Check:
https://plugincafe.maxon.net/topic/5814/5872_meshsequence-exporter&PID;=24678#24678

and for the correct save options search in the coffeesymbols.h file for : SAVEDOCUMENTFLAGS

Cheers
Lennart

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 29/06/2011 at 10:48, xxxxxxxx wrote:

Thanks.
But in that example. The File Browser is used. Which is what I want to avoid.
And when I try using the other flags in it. The file browser always launches no matter which flags I use.

What am I missing?

-ScottA

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 29/06/2011 at 10:51, xxxxxxxx wrote:

Then just skip the SaveDialog and provide a path to be used in the SaveDocument() directly.
(The 'tofile' in the loop of that example)

Cheers
Lennart

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 29/06/2011 at 11:18, xxxxxxxx wrote:

I tried that. But the file browser still launches.
Here's a simpler example:

import c4d  
from c4d import documents, storage  
  
def main() :  
  
  filepath = "/Users/User/Desktop/test.c4d"  
  c4d.documents.SaveDocument(doc,filepath,c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST,c4d.FORMAT_C4DEXPORT)  
  
if __name__=='__main__':  
  main()

No matter what flags I use. The File Browser always launches.

-ScottA

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 29/06/2011 at 14:09, xxxxxxxx wrote:

I copied and pasted your code into the scriptmanager, only changing "User" to "lennart"
and it saves without opening any dialog to my desktop, so I really don't know what problem
you are facing.

Cheers
Lennart

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 29/06/2011 at 14:26, xxxxxxxx wrote:

That was the clue I needed.
You're a mac user right?
I'm a PC user.

I guess we have to use different escapes.
If I use this it works for me on a PC: filepath = "\\Users\\User\\Desktop\ est.c4d"

Thanks for the help.:beer:

-ScottA

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 29/06/2011 at 15:43, xxxxxxxx wrote:

Try use platform independent paths.
Cheers
Lennart

  
import os   
import c4d   
from c4d import storage   
  
path = c4d.storage.GeGetC4DPath(c4d.C4D_PATH_DESKTOP)   
path = os.path.join(path,'testscene.c4d')