On 28/02/2018 at 05:16, xxxxxxxx wrote:
Hi there,
I have written a SceneSaverData to export documents to a new format. It works just file, no problems there. I can also use c4d.documents.SaveDocument(doc, filename, c4d.SAVEDOCUMENTFLAGS_EXPORTDIALOG|c4d.SAVEDOCUMENTFLAGS_DIALOGSALLOWED, mySceneSaversPluginId) from e.g. a Python Script to start the document export. No problems either.
But here it comes: In the Python documentations, it states:
_<_dt id="c4d.s.save" style=": rgb55, 5, 82; color: white;"_>_c4d.documents.SaveDocument
(doc, name, saveflags, format)
Saves the document to a file.
See also
The script that shows how to effectively access and change the settings of an importer/exporter.
See also
Warning note in SceneSaverData.Save()
.
Parameters:|
- doc (c4d.documents.BaseDocument) – Command ID
- name (str or
MemoryFileStruct
) – File to save the document to.
<_<_t_>_
But when I do something like this in a script:
** mfs = c4d.storage.MemoryFileStruct()**
** mfs.SetMemoryWriteMode()**
** result = c4d.documents.SaveDocument(doc, mfs, c4d.SAVEDOCUMENTFLAGS_EXPORTDIALOG|c4d.SAVEDOCUMENTFLAGS_DIALOGSALLOWED|c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, ID_MYSCENESAVERDATA)**
...I always get a string as the name argument in my SceneSaverData's Save() method, and the string only contains "mfs:///". Of course, that's not a valid filename, so I can't create a file at that location.
Long story short:
Should I not get the MemoryFileStruct object as name?
How can I support the usage of a MemoryFileStruct in my own SceneSaverData?
Thanks in advance for any help!
Cheers,
Frank