内容表

关于

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

采样

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 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:

FieldLayer

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

类型

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 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

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

延伸阅读

FIELDLAYER_QUANTIZE_STEPS
@ FIELDLAYER_QUANTIZE_STEPS
定义: flquantize.h:6
FieldLayer
定义: c4d_fielddata.h:1151
maxon::Mat3< maxon::Vector64 >
DescID
定义: lib_description.h:327
CUSTOMDATATYPE_FIELDLIST
#define CUSTOMDATATYPE_FIELDLIST
定义: 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.
定义: c4d_fielddata.h:90
maxon::BaseArray::Resize
ResultMem Resize(Int newCnt, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::DEFAULT)
定义: basearray.h:1077
maxon::BaseArray::GetFirst
const MAXON_ATTRIBUTE_FORCE_INLINE T * GetFirst() const
定义: basearray.h:1034
iferr_return
#define iferr_return
定义: resultbase.h:1434
MAXON_SOURCE_LOCATION
#define MAXON_SOURCE_LOCATION
定义: memoryallocationbase.h:66
maxon::BaseArray
定义: 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
定义: vec.h:32
FieldList
Field custom GUI (CUSTOMDATATYPE_FIELDLIST) for the Field list data.
定义: customgui_field.h:58
FieldOutput
定义: c4d_fielddata.h:119
GeData
定义: c4d_gedata.h:82
CustomDataType
Base class for custom data types.
定义: c4d_customdatatype.h:50
FieldLayer::SetStrength
void SetStrength(Float strength)
定义: c4d_fielddata.h:1199
FieldInput
定义: c4d_fielddata.h:537
FIELDS
@ FIELDS
定义: ofalloff_panel.h:16
DESCFLAGS_GET::NONE
@ NONE
None.
GeData::GetCustomDataType
CustomDataType * GetCustomDataType(Int32 datatype) const
定义: c4d_gedata.h:507
FieldList::InsertLayer
maxon::Result< void > InsertLayer(FieldLayer *layer, FieldLayer *parent=nullptr, FieldLayer *prev=nullptr)
Float64
maxon::Float64 Float64
定义: ge_sys_math.h:65
FieldLayer::Alloc
static FieldLayer * Alloc(Int32 type)
定义: c4d_fielddata.h:1328

Copyright  © 2014-2025 乐数软件    

工业和信息化部: 粤ICP备14079481号-1