c4dpy¶
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:
With 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:
- Download the c4dpy version which match your Cinema 4D version.
- Extract the c4dpy executable according to the target operating system.
- Copy the extracted c4dpy executable to the Cinema 4D installation directory along with the other executable files:
Verify Install¶
Windows¶
- Open Command Prompt.
- Drag c4dpy.exe executable into the Command Prompt and press enter.
- c4dpy should run without error and ask your MyMaxon account. Next start you will not need to login again.
- Python interactive interpreter >>> is now available.
Mac¶
- Open Terminal.
- Right-click on c4dpy.app and select Show Package Contents.
- Navigate to the Contents/MacOS directory.
- Drag the c4dpy file into the Terminal window and press return.
- c4dpy should run without error and ask your MyMaxon account. Next start you will not need to login again.
- Python interactive interpreter >>> is now available.
Editor/IDE Setup¶
Note
Visual Studio Code¶
See also
Warning
Windows¶
- Install the Python extension for Visual Studio Code.
- Select the File > Preferences > Settings command (or Ctrl + , shortcut).
- Search the settings for python.pythonPath and set it to point to the full path of the c4dpy.exe file. For example:
![]()
The Python Path is set in the User Settings so c4dpy.exe interpreter is used globally by Visual Studio Code.
Note
Settings can be specified by user, workspace or folder.
- Restart Visual Studio Code.
Note
Mac¶
- Install the Python extension for Visual Studio Code.
- Select the Code > Preferences > Settings command (or Cmd + , shortcut).
- Search the settings for python.pythonPath and set it to point to the full path of the c4dpy Terminal file. For example:
![]()
The Python Path is set in the User Settings so c4dpy interpreter is used globally by Visual Studio Code.
Note
Settings can be specified by user, workspace or folder.
- Restart Visual Studio Code.
Note
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')"