Hi all,
i know the example on github. I tried to export to alembic. But the alembic-file is not written and I don't get any error. If I set the parameter to "c4d.FORMAT_ABCEXPORT" nothing changes. Only when I use "c4d.FORMAT_C4DEXPORT" it writes a file. But thats not what I want. When I use the script on Github and change the "filePath" to an actual path it works only with c4d Export. But not with Alembic.
I wonder what I do wrong. Heres the code:
"""
Export Settings Example
This example shows how to change an exporter settings.
This works also for importers/scene loaders.
"""
import c4d
from c4d import documents, plugins, storage
def main():
# Get Alembic export plugin, 1028082 is its ID
plug = plugins.FindPlugin(1028082, c4d.PLUGINTYPE_SCENESAVER)
if plug is None:
return
# Get a path to save the exported file
filePath = "D:\\a.abc"
if filePath is None:
return
op = {}
# Send MSG_RETRIEVEPRIVATEDATA to Alembic export plugin
if plug.Message(c4d.MSG_RETRIEVEPRIVATEDATA, op):
if "imexporter" not in op:
return
# BaseList2D object stored in "imexporter" key hold the settings
abcExport = op["imexporter"]
if abcExport is None:
return
# Change Alembic export settings
abcExport[c4d.ABCEXPORT_SELECTION_ONLY] = True
abcExport[c4d.ABCEXPORT_PARTICLES] = True
abcExport[c4d.ABCEXPORT_PARTICLE_GEOMETRY] = True
# Finally export the document
if documents.SaveDocument(doc, filePath, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, c4d.FORMAT_ABCEXPORT):
print "Document successfully exported to:"
print filePath
else:
print "Export failed!"
if __name__=='__main__':
main()
Btw: I don't get any error. And if I change the parameter "c4d.FORMAT_ABCEXPORT" back to "1028082" doesnt change anything. And I dont want to get a dialog either.
It's the same with the simple code below:
import c4d
from c4d import documents, plugins, storage
def main():
# Get a path to save the exported file
filePath = "D:\\hallo.abc"
c4d.documents.SaveDocument(doc, filePath, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, c4d.FORMAT_ABCEXPORT)
c4d.EventAdd()
if __name__=='__main__':
main()
Thx in advance!