c4dpy

c4dpy.exe/app is an executable that runs Cinema 4D in Python command-line mode.
It is not only an interpreter, it brings extra features for daily Python development with external code editors/IDEs: auto-completion and debugging.

Warning

Due to a bug since R21, c4dpy is not anymore supported by any Python IDE. However auto-completion can be achieved since S22, see Auto Completion Dummy Package Manual.
For more information see c4dpy.exe and VS Code.

Install

Warning

c4dpy needs a valid installation of Cinema 4D it’s not a standalone.

Note

c4dpy should have the same version than the folder is in it.

R21+:

Since R21 c4dpy is part of the normal installation process so you don’t need to install anything.
However due to the new licensing system, before any usage of it, launch it at least one time in order to license c4dpy otherwise you can pass these argument while executing c4dpy:
  • g_licenseUsername=”[username]”// inform Cinema 4D about the username to authenticate on https://id.maxon.net.

  • g_licensePassword=”[password]” // inform Cinema 4D about the password to authenticate on https://id.maxon.net.

R20:

  1. Download the c4dpy version which match your Cinema 4D version.

  2. Extract the c4dpy executable according to the target operating system.

  3. Copy the extracted c4dpy executable to the Cinema 4D installation directory along with the other executable files:

../../_images/c4dpy_installdirectory.png

Verify Install

Windows

  1. Open Command Prompt.

  2. Drag c4dpy.exe executable into the Command Prompt and press enter.

  3. c4dpy should run without error and ask your MyMaxon account. Next start you will not need to login again.

  4. Python interactive interpreter >>> is now available.

Mac

  1. Open Terminal.

  2. Right-click on c4dpy.app and select Show Package Contents.

  3. Navigate to the Contents/MacOS directory.

  4. Drag the c4dpy file into the Terminal window and press return.

  5. c4dpy should run without error and ask your MyMaxon account. Next start you will not need to login again.

  6. Python interactive interpreter >>> is now available.

#. Python interactive interpreter >>> is now available.

Command-Line

c4dpy runs a script with:

c4dpy script.py

The following command invokes script.py and passes arg argument:

c4dpy script.py -arg

Note

Arguments can be accessed by sys.argv.

The command below loads the module in file.py and passes arg argument:

c4dpy -m file.py -arg

c4dpy also executes Python code in a string:

c4dpy -c "print('Hello')"