9.5.2

Table Of Contents
1180 APPENDIX
APPENDIX 1181
Programming plugins
The built-in XPresso node editor gives you extensive control over how CINEMA 4D objects interact with
one another. In addition to XPresso, CINEMA 4D provides you with a powerful programming language
that enables you to produce plugins that can extend the core functionality of CINEMA 4D.
The C.O.F.F.E.E. Programming Language
COFFEE, CINEMA 4D’s plugin language, is not based on macros or scripts but is a complete and
powerful programming language in its own right. It closely resembles C++ and Java so that if you
are already familiar with these languages you will immediately feel at home with COFFEE; you simply
have to learn the various functions implemented by CINEMA 4D.
To start programming you will need to get hold of the SDK (Source Development Kit) directly from
MAXON; this can be obtained from www.plugincafe.com.
What is the advantage of writing plugins in COFFEE as opposed to using C++? Well, apart from the
ease of integrating new functionality into CINEMA 4D, as you know, CINEMA 4D is a multi-platform
program. Writing plugins in COFFEE means that your new CINEMA 4D function will work immediately
on all those platforms, with no annoying re-compilation or reprogramming.
So that CINEMA 4D can nd its COFFEE programs and load them automatically, they must be placed
in the Plugins folder which should be in the root CINEMA 4D folder. If you check the contents of this
folder, you will nd some examples already there. However, you can also store COFFEE programs
elsewhere on your hard disk. If you want to load such a program into CINEMA 4D just use the File >
Open menu command — a le stored outside the Plugins folder cannot be automatically integrated
into CINEMA 4D’s menu structure.
How do you create a plugin? Simply write your COFFEE programs in any text editor or word processor
and save it as a regular ASCII text le; CINEMA 4D will happily process regular text, with no high-
ASCII characters.
The SDK
Perhaps you do not want to use COFFEE as your programming language? As usual, CINEMA 4D allows
you the exibility to do it the way you want to; if you like, you can write your applications with any
C++ compiler. Here you have access to the functionality of CINEMA 4D through pre-dened interfaces.
These interfaces are in the form of an API (Application Programming Interface) library which is part
of CINEMA 4D’s SDK. Note, however, that if you use an external compiler (as opposed to COFFEE) this
will be platform dependent and you will need to re-compile your program for each platform on which
you want your plugin to work. You may also need to do some reprogramming.
The C++ SDK is included with CINEMA 4D. You’ll nd it in CINEMA 4D’s Plugins folder.