c4d.modules.mograph.FieldInput

class c4d.modules.mograph.FieldInput

New in version R20.

Attributes

FieldInput._blockCount

[Read-only]

The number of elements to be processed. The count to use when iterating over elements in FieldObject and FieldLayer.

Type: int

FieldInput._blockOffset

[Read-only]

The offset (starting point) of the elements if a portion of a larger array. Used for example to get the actual index in the list: actualIndex = index - points._blockOffset.

Type: int

FieldInput._fullArraySize

[Read-only]

The full size of the source data. May be larger than _blockCount and also might be larger than the size of the allocated block within the c4d.modules.mograph.FieldInput.

Warning

Do no use _fullArraySize to browse the arrays.

Type: int

FieldInput._transform

[Read-only]

The transform matrix for the points in the input block. Use to bring the position and direction lists into world space or the local space of a FieldObject.

Type: c4d.Matrix

FieldInput._position

[Read-only]

The position values for the array of points. If it is a sub-block then element 0 is at _blockOffset within the larger block.

Type: List[c4d.Vector]

FieldInput._direction

[Read-only]

The direction values for the array of points. If it is a sub-block then element 0 is at _blockOffset within the larger block.

Type: List[c4d.Vector]

FieldInput._uvw

[Read-only]

The uvw values for the array of points. If it is a sub-block then element 0 is at _blockOffset within the larger block.

Type: List[c4d.Vector]

Methods Signatures

FieldInput.__init__(self, position, ...[, ...])

Creates a FieldInput instance.

FieldInput.GetSubBlock(self, offset, blockSize)

Retrieves a FieldInput for a subset of the original block.

FieldInput.IsValid(self)

Checks if the FieldInput allocations and sizes are valid.

FieldInput.IsPopulated(self)

Checks if the FieldInput is valid and non-empty.

FieldInput.GetCount(self)

Returns the number of elements in the FieldInput.

FieldInput.GetOffset(self)

Returns the offset of the first element in full arrays.

Methods Documentation

FieldInput.__init__(self, position, allocatedCount, transform=None, fullCount=NOTOK, direction=None, uvw=None)

Creates a FieldInput instance.

Parameters
  • position (List[c4d.Vector]) – The position list to sample.

  • allocatedCount (int) – The length of the position list.

  • transform (Optional[c4d.Matrix]) – The transform matrix required to convert the position and direction inputs to global space.

  • fullCount (Optional[int]) – The full position count if allocatedCount is too big to allocate position list. If not set allocatedCount is used instead.

  • direction (Optional[List[c4d.Vector]]) – The direction list to sample.

  • uvw (Optional[List[c4d.Vector]]) – The uvw list to sample.

Return type

c4d.modules.mograph.FieldInput

Returns

The created FieldInput instance.

FieldInput.GetSubBlock(self, offset, blockSize)

Retrieves a FieldInput for a subset of the original block.

Note

Useful to pass smaller blocks to the field processing threads.

Parameters
  • offset (int) – The sub-block start offset.

  • blockSize (int) – The size of the desired sub-block. 400 is the recommended size.

Return type

c4d.modules.mograph.FieldInput

Returns

The sub-block FieldInput.

FieldInput.IsValid(self)

Checks if the FieldInput allocations and sizes are valid.

Note

Default empty FieldInput is considered valid.

Return type

bool

Returns

True if the FieldInput is valid, otherwise False.

FieldInput.IsPopulated(self)

Checks if the FieldInput is valid and non-empty.

Return type

bool

Returns

True if the FieldInput is populated, otherwise False.

FieldInput.GetCount(self)

Returns the number of elements in the FieldInput.

Return type

int

Returns

The number of elements.

FieldInput.GetOffset(self)

Returns the offset of the first element in full arrays.

Return type

int

Returns

The offset.