FieldList Manual

About

FieldList is a custom data type that stores field layers (FieldLayer). Such a field layer represents a certain function or is referencing a FieldObject (FLfield). Typically one samples this FieldList and not the layers themselves.

A FieldList parameter can be found on MoGraph effectors or the "Falloff" shader.

The data type ID is CUSTOMDATATYPE_FIELDLIST.

FieldList

Sampling

The FieldList is easily sampled using these functions. The "Sample" functions sample the field in a multi-threaded context. If it is needed to control the sampling process use the "Direct" functions.

For information on FieldInfo and FieldOutput see FieldObject Manual.

// This example reads the "FIELDS" parameter of the given "Plain" effector
// to obtain the FieldList custom data. The FieldList is then sampled.
// get FieldList data
const DescID fieldParameterID { FIELDS };
GeData data;
if (plainEffector->GetParameter(fieldParameterID, data, DESCFLAGS_GET::NONE) == false)
return maxon::UnexpectedError(MAXON_SOURCE_LOCATION);
// get FieldList
FieldList* const fieldList = static_cast<FieldList*>(customData);
if (fieldList == nullptr)
return maxon::UnexpectedError(MAXON_SOURCE_LOCATION);
// prepare arrays
positions.Resize(sampleCnt) iferr_return;
uvws.Resize(sampleCnt) iferr_return;
directions.Resize(sampleCnt) iferr_return;
// set positions
Float64 xOffset = 0.0;
for (maxon::Vector& pos : positions)
{
pos.x = xOffset;
xOffset += stepSize;
}
// define points to sample
FieldInput points(positions.GetFirst(),
directions.GetFirst(),
uvws.GetFirst(),
sampleCnt,
Matrix());
// sample
FieldOutput results = fieldList->SampleListSimple(*plainEffector, points) iferr_return;

Layers

The layers stored in the FieldList are accessed through:

Settings

FIELDLIST_FLAGS: are accessed through:

Further functions are:

FieldLayer

A FieldLayer represents a certain function or is referencing a FieldObject. To implement custom layers see FieldLayerData Manual.

Types

Existing layer types are:

Creation

A new layer is created with:

The FieldLayer tree can be navigated with:

// This example creates a new "Quantize" layer and inserts it into the FieldList of the given "Plain" effector.
const DescID fieldParameterID { FIELDS };
GeData data;
if (plainEffector->GetParameter(fieldParameterID, data, DESCFLAGS_GET::NONE) == false)
return maxon::UnexpectedError(MAXON_SOURCE_LOCATION);
// get FieldList
FieldList* const fieldList = static_cast<FieldList*>(customData);
if (fieldList == nullptr)
return maxon::UnexpectedError(MAXON_SOURCE_LOCATION);
// create new "Quantize" layer
if (layer == nullptr)
return maxon::OutOfMemoryError(MAXON_SOURCE_LOCATION);
// configure new layer
layer->SetStrength(0.5);
// insert layer
fieldList->InsertLayer(layer, nullptr, nullptr) iferr_return;
// store data
plainEffector->SetParameter(fieldParameterID, data, DESCFLAGS_SET::NONE);

Properties

If the layer links to another element in the scene this element can be accessed through:

The strength of a layer is defined by:

The blending mode (see flbase.h) is set/get by:

The channel flags (FIELDLAYER_CHANNELFLAG) are accessed through:

The channel flags are:

The layer flags (FIELDLAYER_FLAG) are set/get by:

The layer flags are:

Mask layers are handled with:

Sampling

A layer can directly be sampled by these functions:

FieldListGui

FieldListGui is the custom GUI element to display FieldList data. The GUI ID is CUSTOMGUI_FIELDLIST.

Further Reading

FieldLayer
Definition: c4d_fielddata.h:1147
maxon::Mat3< maxon::Vector64 >
DescID
Definition: lib_description.h:328
CUSTOMDATATYPE_FIELDLIST
#define CUSTOMDATATYPE_FIELDLIST
Definition: customgui_field.h:26
FieldList::SampleListSimple
maxon::Result< FieldOutput > SampleListSimple(BaseList2D &caller, const FieldInput &inputs, FIELDSAMPLE_FLAG flags=FIELDSAMPLE_FLAG::ALL)
FLquantize
static const Int32 FLquantize
FieldLayer quantize remapping layer.
Definition: c4d_fielddata.h:86
maxon::BaseArray::Resize
ResultMem Resize(Int newCnt, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::DEFAULT)
Definition: basearray.h:1077
maxon::BaseArray::GetFirst
const MAXON_ATTRIBUTE_FORCE_INLINE T * GetFirst() const
Definition: basearray.h:1034
iferr_return
#define iferr_return
Definition: resultbase.h:1465
MAXON_SOURCE_LOCATION
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:66
maxon::BaseArray
Definition: basearray.h:366
DESCFLAGS_SET::NONE
@ NONE
None.
C4DAtom::SetParameter
Bool SetParameter(const DescID &id, const GeData &t_data, DESCFLAGS_SET flags)
maxon::Vec3< Float, 1 >
maxon::Vec3::x
T x
Definition: vec.h:32
FieldList
Field custom GUI (CUSTOMDATATYPE_FIELDLIST) for the Field list data.
Definition: customgui_field.h:58
FieldOutput
Definition: c4d_fielddata.h:115
FIELDS
@ FIELDS
Definition: ofalloff_panel.h:16
GeData
Definition: c4d_gedata.h:82
CustomDataType
Base class for custom data types.
Definition: c4d_customdatatype.h:50
FieldLayer::SetStrength
void SetStrength(Float strength)
Definition: c4d_fielddata.h:1195
FieldInput
Definition: c4d_fielddata.h:533
FIELDLAYER_QUANTIZE_STEPS
@ FIELDLAYER_QUANTIZE_STEPS
Definition: flquantize.h:6
DESCFLAGS_GET::NONE
@ NONE
None.
GeData::GetCustomDataType
CustomDataType * GetCustomDataType(Int32 datatype) const
Definition: c4d_gedata.h:507
FieldList::InsertLayer
maxon::Result< void > InsertLayer(FieldLayer *layer, FieldLayer *parent=nullptr, FieldLayer *prev=nullptr)
Float64
maxon::Float64 Float64
Definition: ge_sys_math.h:67
FieldLayer::Alloc
static FieldLayer * Alloc(Int32 type)
Definition: c4d_fielddata.h:1324