Cannot export to FBX from command line
-
On 03/01/2017 at 08:54, xxxxxxxx wrote:
The FBX exporter ID is fine. I tested the code I posted on Windows but not on Mac.
Have you tried to execute Commandline.app instead of Cinema 4D.app? This app should be used instead of the normal one for Command Line operations.
-
On 04/01/2017 at 07:41, xxxxxxxx wrote:
Hi Yannick,
Well, still no luck here, even on Windows with R18. However, the file exports fine with R15. Which version did you use ? I'm going to try on R17 now. -
On 04/01/2017 at 07:48, xxxxxxxx wrote:
Also working with R17, can you confirm you get the same result with R18 on your side ?
-
On 04/01/2017 at 09:46, xxxxxxxx wrote:
Hi,
I confirm there's an issue exporting FBX files in command line with R18 indeed. It will be fixed with the next update.
-
On 04/01/2017 at 10:06, xxxxxxxx wrote:
Alright, Is there a bug tracker or do you have a rough idea when this will be available ?
Thanks a lot for your help! -
On 05/01/2017 at 04:33, xxxxxxxx wrote:
There's only an internal bug tracker. Hopefully an update will be released soon.
-
On 06/01/2017 at 10:37, xxxxxxxx wrote:
Hi I ran into another problem and I couldn't find a solution, it seems that C4D will try to load any file which path is passed as an argument.
For example :
"/Applications/MAXON/CINEMA 4D R17/Commandline.app/Contents/MacOS/Commandline" -ExportFBX -src "[absolute path]/testScene.c4d" -dst "[absolute path]/testScene.fbx"
crashes C4D, apparently because it's trying to load the fbx."/Applications/MAXON/CINEMA 4D R17/Commandline.app/Contents/MacOS/Commandline" "[absolute path]/testScene.fbx"
crashes it too.I tried to "consume" arguments in sys.arg in pluginMessage(id=C4DPL_COMMANDLINEARGS) but the crash occurs before that.
So far, the only way I found arround that is to omit the file extension in the paths provided as arguments
For example :
"/Applications/MAXON/CINEMA 4D R17/Commandline.app/Contents/MacOS/Commandline" -ExportFBX -src "[absolute path]/testScene" -dst "[absolute path]/testScene"Then i can append the file extensions in the script but I have to assume the file extension is lower case, Is there a better way ?
Thanks. -
On 09/01/2017 at 08:42, xxxxxxxx wrote:
Hi Thomas,
The sys.argv command line arguments passed to C4DPL_COMMANDLINEARGS plugin message can't be consumed currently.
I'll see if a better workaround can be used to avoid Cinema 4D from loading filenames passed as command line arguments.
-
On 08/03/2017 at 05:51, xxxxxxxx wrote:
Hi Thomas,
Sorry for my late reply.
A workaround to avoid Cinema from recognizing file paths is to merge the command switches -src and -dst with the file names in the same strings, for instance:
-ExportFBX "-src [absolute path]/testScene.c4d" "-dst [absolute path]/testScene.fbx"The string can then be split like this:
srcSwitch, srcFile = arg.split(' ', 1) if srcSwitch != '-src': return False # This line is needed to fix spaces on OSX srcFile = srcFile.replace('\\ ', ' ')
-
On 01/08/2017 at 04:22, xxxxxxxx wrote:
~~I am running into this problem as well in R18 (SP3); both Commandline and -nogui options will return true for the save command but no FBX file is written.
Any new information on a resolution would be wonderful, if available.
Thanks!
~~
EDIT:
I retract this; after updating I had not retried a thread solution. I can confirm The ExportFBX example provided in this thread works properly for both Commandline and -nogui in Cinema 4D R18.057, resulting in a file being written.