I am trying to run python code on our linux render nodes like I do with c4dpy on our windows render nodes. There is a c4d python module and a maxon provided python interpreter in the linux render node software so this looks like it should work.
I set up my test environment to use the Cinema 4D provided modules with the following:
export PYTHONPATH=/opt/maxon/cinema4dr21.022/bin/resource/modules/python/libs/linux64/python.linux64.framework/lib64/python2.7/lib-dynload:/opt/maxon/cinema4dr21.022/bin/resource/modules/python/libs/python27
export PATH=/usr/lib64/qt-3.3/bin:/root/perl5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/opt/maxon/cinema4dr21.022/bin
export LD_LIBRARY_PATH=/opt/maxon/cinema4dr21.022/bin/../lib64:/opt/maxon/cinema4dr21.022/bin/../bin/resource/modules/python/libs/linux64/python.linux64.framework/lib64
export LC_NUMERIC=en_US.UTF-8
I create a test file with the following code:
import os
import sys
import c4d
from c4d import documents
def main():
filename = "testscene.c4d"
flags = c4d.SCENEFILTER_NONE
doc = c4d.documents.LoadDocument( filename, flags )
if name=='main':
main()
I tested this code on my windows node with:
c4dpy.exe testc4d.py
It completes without error.
On the linux node, I directly call the included python2.7 and run the above script with the following line:
/opt/maxon/cinema4dr21.022/bin/resource/modules/python/libs/linux64/python.linux64.framework/bin/python2.7 testc4d.py
The result is the following error:
Traceback (most recent call last):
File "/storage/neo/Assets/Software/maxon/cinema4d/c4dpy/scripts/testc4d.py", line 3, in
import c4d
File "/opt/maxon/cinema4dr21.022/bin/resource/modules/python/libs/python27/c4d/init.py", line 1, in
from c4d import utils
File "/opt/maxon/cinema4dr21.022/bin/resource/modules/python/libs/python27/c4d/utils/init.py", line 1, in
from c4d.c4d_enums import *
ImportError: No module named c4d_enums
It seems like the submodule c4d_enums is missing from the c4d module. Does anyone know how to make this work? I contacted support at Maxon and they said I should ask here.