Cinema 4D Cinema 4D Visualize, Broadcast, Studio MoGraph Effectors C.O.F.F.E.E.
Function available in CINEMA 4D Broadcast, Studio
COFFEE

Basic Coord. Effector Parameter Deformer Falloff

Effector

Strength [-∞..+∞%]

Use this setting to adjust the overall strength of the effect. Values of less than 0% and greater than 100% can be entered.

Selection

At left a Step Effector without a selection, at right with a selection.

A MoGraph Selection or MoGraph Weightmap tag can be dragged into this field or placed automatically by selecting a Cloner Object and an existing MoGraph selection/weighting, and creating an Effector.

The Effector will then work as follows, depending on the tag’s settings:

 Min/Max

Maximum [-∞..+∞%]

Use these settings to increase or decrease internal range values.

Minimum [-∞..+∞%]
Mode

Here you can define the degree to which the C.O.F.F.E.E. Effector should control the Clones.

Parameter Control

In this mode, only the Effector parameters themselves will be controlled (e.g., Position, Scale, Weight Transform, etc.). The respective parameters can simply be dragged into the Code field or the Expression Editor:

Full Control

Here you have full control over the Clones. You can, for example, position Clones wherever you like, add or remove Clones or modify any value you like. This option is often faster than using the Parameter Control mode.

Code

Enter the C.O.F.F.E.E. code here by clicking the Open COFFEE Editor button.

The C.O.F.F.E.E. editor also recognizes the following constants and classes (what is referred to as "particle" in the following is named "Clone" in the Cinema 4D documentation):

Constants

Classes

int GetCount()

Gets the number of MoGraph particles in the MoData

returns int number

no arguments

boolean SetCount(int COUNT)

Sets the number of MoGraph particles in the MoData

returns boolean - success of redimensioning

Arguments

int COUNT: The number of particles desired

array GetArray(int ID);

Gets the specific array of particle data in the MoData for direct manipulation, the number of elements in the array is the same as the number of particles in the data.

returns array - See Constants for the type of array returned.

Arguments

int ID - The ID of which array you want to access, the id's are the constants listed above (MODATA_MATRIX, MODATA_COLOR, MODATA_TIME, MODATA_CLONE, MODATA_UVW, MODATA_WEIGHT, MODATA_FLAGS)

boolean SetArray(int ID, array VALUES{, boolean APPLY_FALLOFF})

Sets the specific array of particle data in the MoData object, the number of elements in the array should be the same as the number of particles in the data, if it is not then either the MoData will be resized to fit the new array!

returns bolean - Success of setting the array

Arguments

int ID - The ID of which array you want to access, the id's are the constants listed above (MODATA_MATRIX, MODATA_COLOR, MODATA_TIME, MODATA_CLONE, MODATA_UVW, MODATA_WEIGHT, MODATA_FLAGS)

array VALUES - The array being set, it must match the type of data for the ID, and should ideally be sized to match the number of particles in the MoData

boolean APPLY_FALLOFF - If set to True the Effector’s falloff will be applied to the data as it is set, if False or omitted then the data will go in as is

array GetFalloffs();

Retrieves and array of falloffs to be manually applied if wished to the MoGraph data

returns array - The array of falloffs (float) values, usually ranging from 0.0 to 1.0

float SampleFalloff(vector POSITION)

Samples the falloff at the position given

returns float - The strength of the effectors falloff at this position

no arguments

object GetGenerator()

Gets the generator (cloner, matrix object, text object, instance object, fracture object) that owns the modata currently being modified.

returns object - The generator being modified

no arguments

int GetCurrentIndex()

(PARAMETER CONTOL MODE OF C.O.F.F.E.E. EFFECTOR ONLY)

Retrieves the current modata particle index being modified

returns int - The current index

no arguments

int GetBlendID()

(PARAMETER CONTROL MODE OF C.O.F.F.E.E. EFFECTOR ONLY)

Retrieves the current interface ID of the parameter in the Effector whose strength of effect is being asked for

returns int - The current interface ID

no arguments

boolean CopyTo(MoData DEST)

Copies the MoData to another MoData

returns boolean - Success of copy

Arguments

MoData DEST - The destination MoData object, this should be allocated before use (i.e. var mymodata = new(MoData); if (othermodata->CopyTo(mymodata)) do something;

MoData GetClone()

Gets a clone of the MoData for use elsewhere

returns MoData - the clone of the modata

no arguments

MoData GeGetMoData(effector)

Must be placed at the front of a function in order to read out the MoData particle information (see also the default code bits when the Effector is opened)

int GetArrayCount()

Returns the number of different arrays available in the modata

int GetArrayID(int index);

Returns the ID for the array number "index", the ID is used to GetArray/SetArray etc

int GetArrayType(int id);

Returns the type of the array, matrix, real, etc. See the C++ api for DTYPE's

string GetArrayName(int id);

Returns the name of the array if it has one

int GetArrayFlags(int id);

Returns the flags for a specific array, see c4d_baseeffector.h in the C++ api

BooleAddArray(int id, int type, [string name, int flags]);

Adds an array to the MoData

BooleRemoveArray(int id);

Removes an array from the modata

basecontainer GetContainer(int id = -1);

Gets the arrays container, when set to -1 gets the MoData's own container

BooleSetContainer(int id, basecontainer bc);

Sets an arrays container.

int GetDirty();

Gets the dirtyness of the modata, i.e., if the arrays have been resized etc.the value gets incremented

void SetDirty();

Sets the MoData to be dirty.

Open COFFEE Editor

This opens the Expression Editor, which is somewhat more convenient than using the Code field. These fields are connected with one another so it makes no difference where the code is entered.