COFFEE (Cinema 4D)
   HOME

TheInfoList



OR:

COFFEE (often written as "C.O.F.F.E.E") was a
computer A computer is a machine that can be Computer programming, programmed to automatically Execution (computing), carry out sequences of arithmetic or logical operations (''computation''). Modern digital electronic computers can perform generic set ...
scripting language In computing, a script is a relatively short and simple set of instructions that typically automation, automate an otherwise manual process. The act of writing a script is called scripting. A scripting language or script language is a programming ...
that forms part of
CINEMA 4D Cinema 4D is a 3D software suite developed by the German company Maxon. Overview As of R21, only a single version of Cinema 4D is available. It replaces all previous variants, including BodyPaint 3D, and includes all features of the past 'Stu ...
, a proprietary 3D graphics application. Although presented as an
acronym An acronym is a type of abbreviation consisting of a phrase whose only pronounced elements are the initial letters or initial sounds of words inside that phrase. Acronyms are often spelled with the initial Letter (alphabet), letter of each wor ...
the letters of the word COFFEE allegedly stand for ''Cinema Object-oriented Fery Fast Environment Enhancer'', it is primarily a comic reference to
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
, a considerably more famous computer language. COFFEE has been discontinued with Release 20 of Cinema 4D in 2018.


Purpose

Like most scripting languages, COFFEE is used to extend or modify the functionality of the host software. This technique is preferable to writing a so-called ''
plug-in Plug-in, plug in or plugin may refer to: * Plug-in (computing), a software component that adds a specific feature to an existing computer program ** Audio plug-in, adds audio signal processing features ** Photoshop plugin, a piece of software that ...
'' module using a traditional language such as C for a number of reasons, among them: * The scripting language implicitly handles
memory management Memory management (also dynamic memory management, dynamic storage allocation, or dynamic memory allocation) is a form of Resource management (computing), resource management applied to computer memory. The essential requirement of memory manag ...
on the user's behalf, where C does not; * The language
interpreter Interpreting is translation from a spoken or signed language into another language, usually in real time to facilitate live communication. It is distinguished from the translation of a written text, which can be more deliberative and make use o ...
does not require programs to be
compiled In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
as a separate step before they can be used; * A purpose-built scripting language can be tailored so that it lends itself to its intended usage. For example, COFFEE has built-in mathematical functions that are necessary for 3D graphics programming. There are several different aspects of CINEMA 4D's operation that can be customised using COFFEE scripts, notably additions to the
user interface In the industrial design field of human–computer interaction, a user interface (UI) is the space where interactions between humans and machines occur. The goal of this interaction is to allow effective operation and control of the machine fro ...
and extensions for reading and writing new file formats and creating texture
shaders In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene—a process known as '' shading''. Shaders have evolved to perform a variety of sp ...
. Almost all the main functionality of the application can be accessed from a COFFEE program, and so customised features can look and behave much like those supplied as standard.


Syntax and language features

COFFEE is a fairly typical ''
curly bracket A bracket is either of two tall fore- or back-facing punctuation marks commonly used to isolate a segment of text or data from its surroundings. They come in four main pairs of shapes, as given in the box to the right, which also gives their n ...
'' language and so it would look familiar to any previous user of C/C++, Java,
Perl Perl is a high-level, general-purpose, interpreted, dynamic programming language. Though Perl is not officially an acronym, there are various backronyms in use, including "Practical Extraction and Reporting Language". Perl was developed ...
or anything along those lines. The function and object class definitions are closely modelled after those of C++. However, COFFEE is
dynamically typed In computer programming, a type system is a logical system comprising a set of rules that assigns a property called a ''type'' (for example, integer, floating point, string) to every '' term'' (a word, phrase, or other set of symbols). Usua ...
, and so variables are defined with a simple ''var'' keyword without any reference to their type. Unlike similar scripting languages such as
Squirrel Squirrels are members of the family Sciuridae (), a family that includes small or medium-sized rodents. The squirrel family includes tree squirrels, ground squirrels (including chipmunks and prairie dogs, among others), and flying squirrel ...
and
JavaScript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...
, COFFEE does not use a ''function'' keyword to introduce functions, nor does it require a return type or "void" return like C/C++ - the function definition simply begins with the function name. COFFEE's memory management is handled entirely by a
garbage collection Waste collection is a part of the process of waste management. It is the transfer of solid waste from the point of use and disposal to the point of treatment or landfill. Waste collection also includes the curbside collection of recyclable ...
process; essentially this means that it looks after itself, and the programmer seldom needs to worry about it. However, it is possible to control the process explicitly when necessary. 3D graphics programming makes extensive use of certain mathematical techniques, notably
trigonometry Trigonometry () is a branch of mathematics concerned with relationships between angles and side lengths of triangles. In particular, the trigonometric functions relate the angles of a right triangle with ratios of its side lengths. The fiel ...
and vector arithmetic. COFFEE is well equipped in this area, with a good set of mathematical functions and a built-in vector datatype.


Interface with CINEMA 4D

Since COFFEE is used to extend CINEMA 4D, it clearly needs to make use of the host program's features to some extent. Through the
application programming interface An application programming interface (API) is a connection between computers or between computer programs. It is a type of software Interface (computing), interface, offering a service to other pieces of software. A document or standard that des ...
(API) it is possible to locate 3D objects created by the user and access their internal data structures. For example, a new object can be created or an existing one modified or distorted from a script. Since a major purpose of COFFEE is to allow new file formats to be used, the Cinema API provides features useful for the task; a file input/output class is available and this allows individual items of binary data (such as integers and floating point numbers) to be read and written.


References

{{Reflist


External links


Maxon website
- the makers of CINEMA 4D and COFFEE. Scripting languages