heimlich1024/OD_CopyPasteExternal

cinema 4d just exports empty obj

Closed this issue · 11 comments

when i run the export script in c4d, and then after press the import all i get is an empty file without any geometry :(

do i have to set a temp path somewhere?

i only installed plugins for c4d and 3dcoat, was i meant to install something else? ( sorry for being thick)

and obviously, when you pressed export.. you had an object selected...polygon object that is ?.. also.. mac or pc ?

I tried C4D_CopyToExternal.py on Cinema 4D r18 (mac). But ODVertexData.txt is not appears in my $TMPDIR.

C4D_PasteFromExternal.py import mirrored mesh.

Seems like C4D is having a difficult time writing an intermediate OBJ file to the temporary directory (same location as the script). This means that when the Importer tries to import the .TXT file with the model info, it can't read it as there's nothing there.

I've done a bit of poking around, and it seems like it could be a bug with the .OBJ support in the SaveDocument() command in the C4D Python API.

is this on windows or osx ?.. on windows, the temp folder it writes to, should be the same as when you type %temp% in the explorer window. Could it be, that your C4D writes to a different folder ?

I last tested it on Windows. Looking at the Script, it writes a temporary OBJ to the same directory as the script __file__. I initially thought it was a write-protection issue, but If I change the code to export a .C4D file there's no issue (of course it can't be parsed, but it does at least export) writing to the same folder.

oh.. right.. forgot in c4d thats where i put it.. k.. now.. could you try to run the .exe from a command line, while being in that folder... so.. cd to that folder.. and just run it.. hopefully it'll give some error output... it SHOULD create the odvertdata.txt file in the %temp% folder if successful.

guozc commented

I tried to use C4D_CopyToExternal.py on windows,but there is no export.
In line 80,'documents.SaveDocument' always return False.I replaced it with "documents.SaveDocument(docTemp, obj, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, 1030178)" which i found in other plug-ins.
And then, it works!!Although I don't know why.
Longing for you to update the code at an early date.

I’m still having a problem to load the OBJ in Zbrush. Any updates on this?

documents.SaveDocument(docTemp, obj, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, 1030178)
Thanks! It worked for me too :)

this might be due to newer versions of c4d ?.. if thats confirmed working, i'll modify the code.

Yes, confirming this change for R20. Thanks.