Python Libraries

Introduction

Cinema 4D Python interpreter comes along with default modules of its current version. Nevertheless it’s possible to import modules or even create new ones.

If you import a python module with compiled binaries (e.g. numpy) you should ensure, the compiled binaries are compiled with the same toolset/version than Cinema 4D Python interpreter. See Version.

Use

External libraries can be copied to either a specific Cinema 4D preferences folder or a global preferences folder for all installed Cinema 4D versions (after R20).

For specific Cinema 4D preferences, this means that it will only be accessible within this Cinema 4D version:

  • Windows: %APPDATA%/MAXON/{cinemaversion}/python27/libs.
  • MacOS: ~/Library/Preferences/MAXON/{cinemaversion}/python27/libs.

For global preferences, this means that it will be accessible for all Cinema 4D version after R20:

  • Windows: %APPDATA%/MAXON/python27/libs.
  • MacOS: ~/Library/Preferences/MAXON/python27/libs.

Note

In pre-R20 versions, libraries had to be copied to {cinemaversion}/library/python/packages/{osx/win64}.

Python code in these folders can be imported at any time within Cinema 4D Python environment even from a plugin.

Support

While it’s possible to import and use external libraries, MAXON does not provide support regarding issue encounter with a 3rd party module. If a module is not compatible with Cinema 4D, please contact the original module developer.