Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. fyeng
    F
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    fyeng

    @fyeng

    0
    Reputation
    14
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    fyeng Unfollow Follow

    Latest posts made by fyeng

    • Python on Linux missing submodule?

      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.

      posted in General Talk
      F
      fyeng