SOLVED R20 Alembic Export Crash

Hi,

I'm trying to use the ExportAlembic.py example in Cinema 4D R20 but the application crashes.

The same example works in R19.

Doing it manually via File > Export... > Alembic (*.abc) does work.

Tried in both Windows 10 and macOS.

While in macOs the crash reporter makes a log, in Windows, the applications freezes with "Preparing Project for Export" in the status bar.

Hi @dev-vfxboat, first of all, welcome in the plugincafe community.

This is a known bug and already fixed for SP2 (the next Service Pack). It's impacting both Python and C++.
The workaround is to pass the flag c4d.SAVEDOCUMENTFLAGS_DIALOGSALLOWED to the SaveDocument function.

Moreover, don't worry, but please make sure to read and use How to Post Questions (Especially about tagging system)

Cheers,
Maxime.

This seems to still be happening in R20 for me and the workaround didn't seem to help. I don't see any mention of it in the release notes. This method succeeds (successful export) but Cinema freezes. I am on R20 059 (SP2 HF1) on Windows 10

void ExampleDialog::exportObj(BaseObject* obj) {
	AutoAlloc<BaseDocument> virtualDoc;
	virtualDoc->InsertObject(obj, nullptr, nullptr);
	String filepath = "D:\\Dropbox\\model.obj";
	SaveDocument(virtualDoc, filepath, SAVEDOCUMENTFLAGS::DIALOGSALLOWED, 1030178);
}

Hi @ryangordon, the Id (1030178) correspond to FORMAT_OBJ2EXPORT. So consider that both ABC and OBJ exporter is crashing in your case.

Here I'm not able to reproduce with the next code

AutoAlloc<BaseDocument> virtualDoc;
AutoAlloc<BaseObject> obj{Ocube};
virtualDoc->InsertObject(obj, nullptr, nullptr);
String filepath = "C:\\Users\\m_adam\\Desktop\\model.obj";
SaveDocument(virtualDoc, filepath, SAVEDOCUMENTFLAGS::DIALOGSALLOWED, FORMAT_OBJ2EXPORT);

So I'm wondering if you really own the BaseObject pointer and if the issue is not there. Maybe the object is already inserted. If you can provide a full example it will help me to reproduce.

Cheers,
Maxime.

Ah I think you're right - I take the object right from the document without a clone or anything. Thank you!