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 .
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
// get FieldList CustomDataType * const customData = data. GetCustomDataType ( CUSTOMDATATYPE_FIELDLIST ); FieldList * const fieldList = static_cast< FieldList * > (customData); if (fieldList == nullptr ) return maxon::UnexpectedError( MAXON_SOURCE_LOCATION );
// prepare arrays maxon::BaseArray<maxon::Vector> positions; positions. Resize (sampleCnt) iferr_return ; maxon::BaseArray<maxon::Vector> uvws; uvws. Resize (sampleCnt) iferr_return ; maxon::BaseArray<maxon::Vector> directions; 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, 矩阵 ());
// sample FieldOutput results = fieldList-> SampleListSimple (*plainEffector, points) iferr_return ;
The layers stored in the FieldList are accessed through:
FIELDLIST_FLAGS : are accessed through:
Further functions are:
A FieldLayer represents a certain function or is referencing a FieldObject . To implement custom layers see FieldLayerData Manual .
Existing layer types are:
A new layer is created with:
The FieldLayer tree can be navigated with:
// get FieldList CustomDataType * const customData = data. GetCustomDataType ( CUSTOMDATATYPE_FIELDLIST ); FieldList * const fieldList = static_cast< FieldList * > (customData); if (fieldList == nullptr ) return maxon::UnexpectedError( MAXON_SOURCE_LOCATION );
// create new "Quantize" layer FieldLayer * const layer = FieldLayer::Alloc ( FLquantize ); if (layer == nullptr ) return maxon::OutOfMemoryError( MAXON_SOURCE_LOCATION );
// configure new layer layer-> SetParameter ( FIELDLAYER_QUANTIZE_STEPS , 10, DESCFLAGS_SET::NONE ); layer-> SetStrength (0.5);
// insert layer fieldList-> InsertLayer (layer, nullptr , nullptr ) iferr_return ;
// store data plainEffector->SetParameter(fieldParameterID, data, DESCFLAGS_SET::NONE );
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:
A layer can directly be sampled by these functions:
FieldListGui is the custom GUI element to display FieldList data. The GUI ID is CUSTOMGUI_FIELDLIST .