Xcode is the only supported IDE and compiler for producing Cinema 4D plugins for macOS. Xcode 14 is not supported. See Development Environments for an overview of supported Xcode versions for different versions of Cinema 4D. When building the SDK for macOS, one must use the sdk.zip
file provided by a macOS installation of Cinema 4D to avoid file permission problems.
Cinema 4D projects for macOS have currently two prerequisites:
Other than older versions of macOS, macOS Monterey does not provide a Python installation. One must provide therefore such interpreter and symbolic links to it, preferably the Python 3 interpreter shipped with the Xcode Command Line Tools. Follow these steps to install the tools and create a symbolic link for the contained Python interpreter:
/Library/Developer/CommandLineTools/
as recommend by Apple.CMD + Space
and type "Terminal"
and press Enter
.Once the Project Tool has ran on a directory of source files and generated the project solution, one must take two steps to successfully compile such solution.
File > Project Settings
and configure it as shown in Fig. II.macOS specific code can be guarded with the macro MAXON_TARGET_MACOS:
Since Cinema 4D R23 Service Pack 1, it's possible to build plugins as Universal Binaries to run them both on Intel-based and ARM-based hardware.
To build Universal Binaries the following development environment is required:
Aside from regenerating the project using the Project Tool, if the plugin's code is fully relying on Cinema 4D APIs, no changes are needed and rebuilding the project will suffice to generate universal binaries running on both platforms.
In case one of the two architectures is not required you can deactivate it by:
3rd-party Libraries Support
If your plugin makes use of 3rd-party libraries, it's recommended to port the library on Apple Silicon - as recommended here - before attempting to build the whole Cinema 4D plugin to streamline the porting process.
It is possible to start Cinema 4D from Xcode to run and debug a plugin:
The Console displays messages printed with DiagnosticOutput(). See Debug and Output Functions.
For general information on debugging see Debugging Techniques.
The execution of the Project Tool can easily be automated using bash scripts.
This bash script executes the Project Tool on the given location of the SDK and starts Xcode to open the solution file:
This bash script starts Cinema 4D with the location of the plugins:
Additionally one can set the command line argument g_runUnitTests to automatically execute custom unit tests.
Cinema 4D can be informed on the type of license model to use - which can be helpful in certain automated tasks - by using:
DYLIBs needed by a plugin can be placed in myplugin\res\libs\osx.
The final plugin build for deployment should be created using the "Release" build target.
Since macOS Catalina 10.15, all Mac software distributed outside the Mac App Store must be notarized by Apple in order to run by default.
The notarization process beside involving Mac applications, also applies to plugins that are supposed to run in notarized applications.
The notarization process is different depending on the type of file to be notarized (an app or a plugin) or on the final archiving strategy used to deploy the plugin. The notary service accepts disk images (UDIF format), signed flat installer packages, and ZIP archives.
Requirements:
Notarization requires Xcode 10 or later. Building a new app for notarization requires macOS 10.13.6 or later.
Apple's notary service requires you to adopt the following protections:
Before the Apple notary service process a binary, it's mandatory to have the binary signed with a valid Apple Developer ID certificate. In case of signing applications or plugins signing the binary requires a Developer ID Application certificate. Such a certificate can be obtained once enrolled to the Apple Developer Program either as individual or as an organization.
The Apple Developer Program is not free and an yearly fee is due to get full membership and generate the Developer ID signing certificates. See Apple Developer Program for further details.
Upon adding an Apple ID owning developer credentials you can add a certificate by clicking on Manage Certificates
the clicking on +
and finally selecting Developer ID Application
Signing a binary in Xcode is required to successfully complete the notarization process as described in Preliminary steps.
To prepare a project to undergo the notarization process the signing options needs to be specified for the project responsible to generate the binary to be notarized.
Given such a project, select the Targets settings and filter for the string "Signing"
change the values for the following parameters:
Upon settings up the signing parameters a Release binary of the plugin must be generated by clicking on Product -> Build For -> Profiling .
After the creation of the release binary, a ZIP archive should be created containing the plugin and all the other needed files. Considering the case of the example.main plugin, upon moving the example_main.xlib and the res folder in a proper folder, to create a zip archive of the files, from a Terminal window, execute:
Later on in the process it's requested to provide the value for the ASC-provider:to retrieve the list of allowed providers, from a Terminal window, execute:
and, if successfully executed, the tool should return
To submit the zip-archive to Apple to complete the notarization process, from a Terminal window, execute:
and, if successfully executed, the tool should return
Within a certain amount of time, Apple Notary Service notifies the user about the notarization process being finished by sending an email to the address bound to the registered Apple ID.
Finally it's possible at anytime to check the notarization queue executing
and, if successfully executed, the tool should return something like