heimlich1024 / OD_CopyPasteExternal

Easily copying and pasting of geometry between 3D Applications
Apache License 2.0
307 stars 49 forks source link

cinema 4d just exports empty obj #30

Closed aleksey-voz closed 6 years ago

aleksey-voz commented 7 years ago

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)

heimlich1024 commented 7 years ago

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

krasnovpro commented 7 years ago

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.

donovankeith commented 7 years ago

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.

heimlich1024 commented 7 years ago

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 ?

donovankeith commented 7 years ago

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.

heimlich1024 commented 7 years ago

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 6 years ago

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.

Limbicnation commented 6 years ago

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

Limbicnation commented 6 years ago

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

heimlich1024 commented 6 years ago

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

Limbicnation commented 6 years ago

Yes, confirming this change for R20. Thanks.