c4d.FieldList¶
-
class
c4d.
FieldList
¶ Field list data type (CUSTOMDATATYPE_FIELDLIST).
New in version R20.
Methods Signatures
Initializes a |
Samples the list with full parameter control. |
|
Samples the list. |
|
Initializes sampling in direct mode. |
|
Samples in direct mode. |
|
Frees any data allocated in |
|
Checks the dirtiness of the field list and its objects. |
|
Retrieves the total number of fields and groups in the list. |
|
Empties the list of all entries, frees any used memory and resets the |
|
Inserts a pre-existing layer into the list. |
|
Retrieves the root |
|
Retrieves a list of all the selected layers in the list. |
|
Sets the flags for the list. |
|
Gets the flags for the list. |
|
Checks a specific flag or combination to see if set. |
|
Checks if the list has content. |
Inheritance
Parent Class:
Methods Documentation
-
FieldList.
SampleList
(self, info, inputs, outputs)¶ Samples the list with full parameter control.
- Parameters
info (c4d.modules.mograph.FieldInfo) – The
FieldInfo
to sample with.inputs (c4d.modules.mograph.FieldInput) – The inputs to sample. A
FieldInput
with a single position can be passed to sample just one point.outputs (c4d.modules.mograph.FieldOutput) – The sample data result.
-
FieldList.
SampleListSimple
(self, caller, inputs, flags)¶ Samples the list.
Note
Use
SampleListSimple()
to avoid pre-creatingFieldInfo
andFieldOutput
.- 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
- 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.
Warning
Due to core changes in 2024.0.0, this function is not working in Python 2024.0.0.This is going to be fixed in an upcoming version.- Parameters
inputs (c4d.modules.mograph.FieldInput) – The inputs to sample from.
outputs (c4d.modules.mograph.FieldOutput) – The sample data result.
info (c4d.modules.mograph.FieldInfo) – The
FieldInfo
to sample with.
- 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.
Warning
Due to core changes in 2024.0.0, this function is not working in Python 2024.0.0.This is going to be fixed in an upcoming version.- 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
layer (c4d.modules.mograph.FieldLayer) – The layer to insert. Must not be already inserted in any other list or in the current list in another location.
parent (Optional[c4d.modules.mograph.FieldLayer]) – The parent layer to insert the layer as a child of.
prev (Optional[c4d.modules.mograph.FieldLayer]) – The previous layer to the one being inserted.
- Return type
bool
- Returns
True if successful, otherwise False.
-
FieldList.
GetLayersRoot
(self, create=True)¶ Retrieves the root
GeListHead
that owns the layers.- Parameters
create (bool) –
New in version 2024.0.0.
True if the root should be created if it does not exist.
- 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.