c4d.FieldList

class c4d.FieldList

Field list data type (CUSTOMDATATYPE_FIELDLIST).

New in version R20.

Methods Signatures

FieldList.__init__(self)

Initializes a FieldList instance.

FieldList.SampleList(self, info, inputs, outputs)

Samples the list with full parameter control.

FieldList.SampleListSimple(self, caller, inputs, flags)

Samples the list.

FieldList.DirectInitSampling(self, info)

Initializes sampling in direct mode.

FieldList.DirectSample(self, inputs, outputs, info)

Samples in direct mode.

FieldList.DirectFreeSampling(self, info)

Frees any data allocated in DirectInitSampling().

FieldList.GetDirty(self, doc)

Checks the dirtiness of the field list and its objects.

FieldList.GetCount(self)

Retrieves the total number of fields and groups in the list.

FieldList.Flush(self)

Empties the list of all entries, frees any used memory and resets the FieldList instance back to its default state.

FieldList.InsertLayer(self, layer[, parent, prev])

Inserts a pre-existing layer into the list.

FieldList.GetLayersRoot(self)

Retrieves the root GeListHead that owns the layers.

FieldList.GetSelected(self, selected[, ...])

Retrieves a list of all the selected layers in the list.

FieldList.SetFlags(self, flag, state)

Sets the flags for the list.

FieldList.GetFlags(self)

Gets the flags for the list.

FieldList.CheckFlag(self, flag)

Checks a specific flag or combination to see if set.

FieldList.HasContent(self)

Checks if the list has content.

Inheritance

Parent Class:

Methods Documentation

FieldList.__init__(self)

Initializes a FieldList instance.

FieldList.SampleList(self, info, inputs, outputs)

Samples the list with full parameter control.

Parameters
FieldList.SampleListSimple(self, caller, inputs, flags)

Samples the list.

Note

Use SampleListSimple() to avoid pre-creating FieldInfo and FieldOutput.

Parameters
  • caller (c4d.BaseList2D) – The caller object. Pass the BaseList2D to invoke the sampling from.

  • inputs (c4d.modules.mograph.FieldInput) – The inputs to sample from.

  • flags (int) –

    The channels to sample:

    FIELDSAMPLE_FLAG_VALUE

    Sample only the value.

    FIELDSAMPLE_FLAG_DIRECTION

    Sample the velocity.

    FIELDSAMPLE_FLAG_COLOR

    Sample the color.

    FIELDSAMPLE_FLAG_ROTATION

    Sample the rotational velocity.

Return type

c4d.modules.mograph.FieldOutput

Returns

The sampling result.

FieldList.DirectInitSampling(self, info)

Initializes sampling in direct mode.

Warning

Must be called before DirectSample() is invoked.

Parameters

info (c4d.modules.mograph.FieldInfo) – The FieldInfo to initialize sampling with.

Return type

bool

Returns

True if successful otherwise False.

FieldList.DirectSample(self, inputs, outputs, info)

Samples in direct mode.

Parameters
Return type

bool

Returns

True if successful, otherwise False.

FieldList.DirectFreeSampling(self, info)

Frees any data allocated in DirectInitSampling().

Warning

Must be called after direct sampling is finished.

Parameters

info (c4d.modules.mograph.FieldInfo) – The FieldInfo used for sampling.

FieldList.GetDirty(self, doc)

Checks the dirtiness of the field list and its objects.

Parameters

doc (Optional[c4d.documents.BaseDocument]) – The document. Can be None.

Return type

int

Returns

The dirty count.

FieldList.GetCount(self)

Retrieves the total number of fields and groups in the list.

Return type

int

Returns

The number of elements in the list.

FieldList.Flush(self)

Empties the list of all entries, frees any used memory and resets the FieldList instance back to its default state.

FieldList.InsertLayer(self, layer, parent=None, prev=None)

Inserts a pre-existing layer into the list.

Parameters
Return type

bool

Returns

True if successful, otherwise False.

FieldList.GetLayersRoot(self)

Retrieves the root GeListHead that owns the layers.

Return type

Optional[c4d.GeListHead]

Returns

The layers root, or None if the function failed.

FieldList.GetSelected(self, selected, includeChildren=True)

Retrieves a list of all the selected layers in the list.

Note

This may include the background layer.

Parameters
  • selected (List[c4d.modules.mograph.FieldLayer]) – The selected layers in the list.

  • includeChildren (Optional[bool]) – True to include children layers, False to exclude.

FieldList.SetFlags(self, flag, state)

Sets the flags for the list.

Parameters
  • flag (int) –

    The flags to set:

    FIELDLIST_FLAGS_NONE

    None.

    FIELDLIST_FLAGS_CLAMPOUTPUT

    Clamp the output values from the field list.

    FIELDLIST_FLAGS_ENABLEDIRECTIONBYDEFAULT

    Direction enabled by default on new layers.

    FIELDLIST_FLAGS_ENABLECOLORBYDEFAULT

    Color enabled by default on new layers.

    FIELDLIST_FLAGS_ENABLEROTATIONBYDEFAULT

    Direction enabled by default on new layers

    FIELDLIST_FLAGS_DISABLEVALUEBYDEFAULT

    Disable the value channel by default on new layers

    FIELDLIST_FLAGS_SIMPLEGUI

    Use simple GUI. Only possible if there is only a single standard field layer in the list.

  • state (bool) – True to set the flag, False to clear it.

FieldList.GetFlags(self)

Gets the flags for the list.

Return type

int

Returns

The flags:

FIELDLIST_FLAGS_NONE

None.

FIELDLIST_FLAGS_CLAMPOUTPUT

Clamp the output values from the field list.

FIELDLIST_FLAGS_ENABLEDIRECTIONBYDEFAULT

Direction enabled by default on new layers.

FIELDLIST_FLAGS_ENABLECOLORBYDEFAULT

Color enabled by default on new layers.

FIELDLIST_FLAGS_ENABLEROTATIONBYDEFAULT

Direction enabled by default on new layers

FIELDLIST_FLAGS_DISABLEVALUEBYDEFAULT

Disable the value channel by default on new layers

FIELDLIST_FLAGS_SIMPLEGUI

Use simple GUI. Only possible if there is only a single standard field layer in the list.

FieldList.CheckFlag(self, flag)

Checks a specific flag or combination to see if set.

Parameters

flag (int) –

The flag to check:

FIELDLIST_FLAGS_NONE

None.

FIELDLIST_FLAGS_CLAMPOUTPUT

Clamp the output values from the field list.

FIELDLIST_FLAGS_ENABLEDIRECTIONBYDEFAULT

Direction enabled by default on new layers.

FIELDLIST_FLAGS_ENABLECOLORBYDEFAULT

Color enabled by default on new layers.

FIELDLIST_FLAGS_ENABLEROTATIONBYDEFAULT

Direction enabled by default on new layers

FIELDLIST_FLAGS_DISABLEVALUEBYDEFAULT

Disable the value channel by default on new layers

FIELDLIST_FLAGS_SIMPLEGUI

Use simple GUI. Only possible if there is only a single standard field layer in the list.

Return type

bool

Returns

True if flag is set, otherwise False.

FieldList.HasContent(self)

Checks if the list has content.

Return type

bool

Returns

True if there is any field layer in the list, otherwise False.