Visual Studio is the only supported IDE and compiler for producing Cinema 4D plugins for Windows. See Development Environments for an overview of supported Visual Studio Versions for different versions of Cinema 4D.
The SDK includes Natvis files for several data types. The files are:
The files can simply be copied to the local "Documents\\Visual Studio 2019\\Visualizers" folder.
Alternatively, it is possible to include the Natvis files in a solution using AdditionalSolutionFiles:
Windows specific code can be guarded with the macro MAXON_TARGET_WINDOWS:
If a source code file includes Windows header files it must also include undef_win_macros.h to un-define certain macros.
#undef COMPONENT
may be needed, depending on the Windows header files involved. This will be added to the undef_win_macros.h
header in a later release.It is possible to start Cinema 4D from Visual Studio to run and debug a plugin:
The Cinema 4D executable must find the compiled plugins. The plugin location can be set with the g_additionalModulePath command line argument. One can also use "$(ProjectDir)..\.." instead of the absolute path.
Additional command line arguments can be set (e.g. to run unit tests). See Unit Tests Manual and Configuration Variables.
The Output console displays messages printed with DiagnosticOutput(). See Debug and Output Functions.
For general information on debugging see Debugging.
The execution of the Project Tool can easily be automated using Windows batch files.
This batch file executes the Project Tool on the given location of the SDK and starts Visual Studio to open the solution file:
This batch file 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:
DLLs needed by a plugin can be placed in myplugin\res\libs\win64.
The final plugin build for deployment should be created using the "Release" build target.