Getting Started: Introduction

Overview

  • The SDK is included in every distribution of Cinema 4D and is stored in the sdk.zip file.
  • The Project Tool can be obtained from developers.maxon.net.
  • The Project Tool must be used to create project files for frameworks, plugins and solutions.
  • The example plugins can be build with the solution in "plugins/project".
  • A new plugin can be added by creating the plugin folder and defining the projectdefinition.txt file.
  • Such a new plugin must be added to a solution.
  • Existing plugins must be adapted to the Cinema 4D R20 SDK, see API Transition.
  • The "classic" API is available in cinema.framwork.
  • The new MAXON API is defined in core.framework and further frameworks.

Getting the SDK

The MAXON API SDK is included in every distribution of Cinema 4D. It is stored in the sdk.zip file. The content of this file can be extracted to any location. See SDK Overview.

The SDK contains several frameworks that provide access to the API's functionality. For an overview see MAXON API Frameworks.

Creating Project Files

The SDK does not include IDE project files. The Project Tool is used to create these project files for the supported operation systems. The tool is available for download on developers.maxon.net. The program can be installed to any location.

Simply run the Project Tool on the command line. The g_updateproject argument is used to define the target folder. The tool will look into this folder and its sub-folders to search for MAXON API frameworks, projects and solutions. For more information see Project Tool.

// This example shows how to run the Project Tool using command line arguments.
// Windows
kernel_app_64bit.exe g_updateproject=C:\development\sdk
// MacOS
kernel_app.app/Contents/MacOS/kernel_app g_updateproject=/Volumes/development/sdk

Build the SDK Examples

Use the Projet Tool as described above to create project files for solutions, plugins and frameworks. Then open the default solution located in "plugins/project".

This default solution includes the three example projects and all necessary frameworks. Simply build the complete solution to build all example projects.

For running Cinema 4D see Development for Microsoft Windows and Development for macOS.

Creating a Plugin Project

A new plugin project is added by creating a new folder in the SDK's "plugins" directory. This new folder must have two sub-folders:

  • project: Must contain the projectdefinition.txt file. This file defines the basic settings of a project. The project file is automatically generated based on these settings.
  • source: Contains the source code of the new plugin.
Note
The Project Tool will add all source code files found in the project folder to the project file. The Source Processor will only process source code files in the "source" folder.

See also Creating a New Plugin Project.

A typical example of a projectdefinition.txt file will look like this:

// Configuration of a custom plugin in the projectdefinition.txt file
// support Windows and macOS
Platform=Win64;OSX
// this is a plugin
Type=DLL
// this plugin depends on these frameworks:
APIS=\
cinema.framework; \
misc.framework; \
image.framework; \
core.framework
// defines the level of rigour of the source processor's style check
stylecheck.level=3
// plugin/module ID
ModuleId=com.examplecompany.myplugin
  • Platform: Defines which IDE project files should be created. "Win64" will create Visual Studio project files, "OSX" will build Xcode project files.
  • Type: Defines that this project is a plugin.
  • APIS: Defines the frameworks needed by this plugin.

This new project must also be added to the solution defined in the "plugins/project" folder. This is done by editing the solution's projectdefinition.txt file. This example added a plugin called "newplugin":

// Configuration of the development solution projectdefinition.txt file
// support Windows and macOS
Platform=Win64;OSX
// this is a Solution
Type=Solution
// included plugin projects
Solution=\
plugins/cinema4dsdk;\
plugins/newplugin

To create the project files of the new plugin and to update the solution's project files one must again run the Project Tool.

It is also possible to add a new solution project. See Custom Solutions

Update Classic API Code

Existing classic API code must be adapted to work within a new MAXON API plugin. It is typically needed to remove references to deprecated classic header files and to include new MAXON API header files. Deprecated classes of the classic API must be replaced with new MAXON API classes.

See API Transition, Replacements and Comparison.

Use new API

A new plugin project can use all features of the MAXON API. For an overview see Plugin Development, API Features and MAXON API Frameworks.

For an introduction to the foundations of the MAXON API see Getting Started: Foundations.