c4d.modules.mograph.FieldOutputBlock

class c4d.modules.mograph.FieldOutputBlock

New in version R20.

Attributes

FieldOutputBlock._value

The weight value array.

Type: List[float]

FieldOutputBlock._alpha

The alpha array for color and direction. Only available when color or direction are allocated.

Type: List[float]

FieldOutputBlock._color

The color array.

Type: List[c4d.Vector]

FieldOutputBlock._direction

The slope direction array.

Type: List[c4d.Vector]

FieldOutputBlock._rotation

The rotational velocity array.

Type: List[c4d.Vector]

FieldOutputBlock._pivot

The rotational velocity (axe + magnitude)

Type: List[c4d.Vector]

FieldOutputBlock._deactivated

The deactivated state array.

Type: List[bool]

Methods Signatures

FieldOutputBlock.__init__(self)

Creates a FieldOutputBlock instance.

FieldOutputBlock.GetSubBlock(self)

Gets a sub-section of the sampling arrays.

FieldOutputBlock.Reset(self)

Resets the FieldOutputBlock instance to an empty state. All memory is deallocated.

FieldOutputBlock.GetCount(self)

Returns the number of elements in the sub-block.

FieldOutputBlock.GetFullCount(self)

Returns the number of elements in the parent FieldOutput.

FieldOutputBlock.GetOffset(self)

Returns the offset of the sub-block in the parent FieldOutput.

FieldOutputBlock.GetOwner(self)

Returns the parent or owner FieldOutput.

FieldOutputBlock.IsValid(self)

Checks if the FieldOutputBlock instance allocations and sizes are valid.

FieldOutputBlock.IsPopulated(self)

Checks if the FieldOutputBlock is valid and non-empty.

FieldOutputBlock.CopyFrom(self, src)

Copies from FieldOutputBlock src.

FieldOutputBlock.CopyArrayContentFrom(self, src)

Copies from src array content.

FieldOutputBlock.ClearMemory(self[, startIdx, ...])

Resets the sampling data to default values.

FieldOutputBlock.ClearDeactivated(self[, state])

Clears the deactivated array.

FieldOutputBlock.CalculateCrc(self)

Calculates a Crc on all internal data.

FieldOutputBlock.GetValue(self, index)

Reads value at specified index.

FieldOutputBlock.SetValue(self, index, value)

Writes value at specified index.

FieldOutputBlock.GetAlpha(self, index)

Reads alpha at specified index.

FieldOutputBlock.SetAlpha(self, index, alpha)

Writes alpha at specified index.

FieldOutputBlock.GetColor(self, index)

Reads color at specified index.

FieldOutputBlock.SetColor(self, index, color)

Writes color at specified index.

FieldOutputBlock.GetDirection(self, index)

Reads direction at specified index.

FieldOutputBlock.SetDirection(self, index, direction)

Writes direction at specified index.

FieldOutputBlock.GetRotation(self, index)

Reads rotation at specified index.

FieldOutputBlock.SetRotation(self, index, rotation, ...)

Writes rotation at specified index.

FieldOutputBlock.GetPivot(self, index)

Retrieve the rotational velocity (axe + magnitude) at specified index.

FieldOutputBlock.GetDeactivated(self, index)

Reads deactivated state at specified index.

FieldOutputBlock.SetDeactivated(self, index, deact)

Writes deactivated state at specified index.

Methods Documentation

FieldOutputBlock.__init__(self)

Creates a FieldOutputBlock instance.

FieldOutputBlock.GetSubBlock(self)

Gets a sub-section of the sampling arrays.

Parameters
  • offset (int) – The offset index to retrieve a sub-block starting at.

  • size (int) – The suggested size of the block. Note the function clamps the size against the maximum number of entries.

Return type

c4d.modules.mograph.FieldOutputBlock

Returns

The requested sub-block.

FieldOutputBlock.Reset(self)

Resets the FieldOutputBlock instance to an empty state. All memory is deallocated.

FieldOutputBlock.GetCount(self)

Returns the number of elements in the sub-block.

Return type

int

Returns

The number of elements.

FieldOutputBlock.GetFullCount(self)

Returns the number of elements in the parent FieldOutput.

Return type

int

Returns

The full number of elements.

FieldOutputBlock.GetOffset(self)

Returns the offset of the sub-block in the parent FieldOutput.

Return type

int

Returns

The offset.

FieldOutputBlock.GetOwner(self)

Returns the parent or owner FieldOutput.

Return type

c4d.modules.mograph.FieldOutput

Returns

The owner.

FieldOutputBlock.IsValid(self)

Checks if the FieldOutputBlock instance allocations and sizes are valid.

Note

An empty FieldOutputBlock instance is considered valid.

Return type

bool

Returns

True if the FieldOutputBlock instance is valid, otherwise False.

FieldOutputBlock.IsPopulated(self)

Checks if the FieldOutputBlock is valid and non-empty.

Return type

bool

Returns

True if the FieldOutputBlock instance is populated, otherwise False.

FieldOutputBlock.CopyFrom(self, src)

Copies from FieldOutputBlock src.

Parameters

src (c4d.modules.mograph.FieldOutputBlock) – The source FieldOutputBlock.

Return type

bool

Returns

True if successful, otherwise False.

FieldOutputBlock.CopyArrayContentFrom(self, src)

Copies from src array content.

Note

Size and flags are not affected by CopyArrayContentFrom().
The destination FieldOutputBlock must be big enough to accept the full content of src.
Parameters

src (c4d.modules.mograph.FieldOutputBlock) – The source FieldOutputBlock.

Return type

bool

Returns

True if successful, otherwise False.

FieldOutputBlock.ClearMemory(self, startIdx=0, count=GetCount, deactivatedOnly=False, deactivatedState=False)

Resets the sampling data to default values.

Note

Values are reset to 0, colors to 1.0, direction to 0, deactivated to 0.

Parameters
  • startIdx (int) – The index to start at.

  • count (int) – The number of array elements to reset to default value.

  • deactivatedOnly (bool) – True to clear deactivated only, otherwise False.

  • deactivatedState (bool) – The state the deactivated array should be cleared to.

FieldOutputBlock.ClearDeactivated(self, state=False)

Clears the deactivated array.

Parameters

state (bool) – The state the deactivated array should be cleared to.

FieldOutputBlock.CalculateCrc(self)

Calculates a Crc on all internal data.

Note

Crc is not kept internally and is calculated from scratch on each CalculateCrc() call.

Return type

int

Returns

The calculated Crc.

FieldOutputBlock.GetValue(self, index)

Reads value at specified index.

Parameters

index (int) – The index in the array.

Raises

IndexError – If the index is out of range : 0<=index<GetCount().

Return type

float

Returns

The value.

FieldOutputBlock.SetValue(self, index, value)

Writes value at specified index.

Parameters
  • index (int) – The index in the array.

  • value (float) – The value to set.

Raises

IndexError – If the index is out of range : 0<=index<GetCount().

FieldOutputBlock.GetAlpha(self, index)

Reads alpha at specified index.

Parameters

index (int) – The index in the array.

Raises

IndexError – If the index is out of range : 0<=index<GetCount().

Return type

float

Returns

The alpha.

FieldOutputBlock.SetAlpha(self, index, alpha)

Writes alpha at specified index.

Parameters
  • index (int) – The index in the array.

  • alpha (float) – The alpha to set.

Raises

IndexError – If the index is out of range : 0<=index<GetCount().

FieldOutputBlock.GetColor(self, index)

Reads color at specified index.

Parameters

index (int) – The index in the array.

Raises

IndexError – If the index is out of range : 0<=index<GetCount().

Return type

c4d.Vector

Returns

The color.

FieldOutputBlock.SetColor(self, index, color)

Writes color at specified index.

Parameters
  • index (int) – The index in the array.

  • color (c4d.Vector) – The color to set.

Raises

IndexError – If the index is out of range : 0<=index<GetCount().

FieldOutputBlock.GetDirection(self, index)

Reads direction at specified index.

Parameters

index (int) – The index in the array.

Raises

IndexError – If the index is out of range : 0<=index<GetCount().

Return type

c4d.Vector

Returns

The direction.

FieldOutputBlock.SetDirection(self, index, direction)

Writes direction at specified index.

Parameters
  • index (int) – The index in the array.

  • direction (c4d.Vector) – The direction to set.

Raises

IndexError – If the index is out of range : 0<=index<GetCount().

FieldOutputBlock.GetRotation(self, index)

Reads rotation at specified index.

Parameters

index (int) – The index in the array.

Raises

IndexError – If the index is out of range : 0<=index<GetCount().

Return type

c4d.Vector

Returns

The rotation.

FieldOutputBlock.SetRotation(self, index, rotation, pivot)

Writes rotation at specified index.

Changed in version R21.

Parameters
  • index (int) – The index in the array.

  • rotation (c4d.Vector) – The rotation to set.

  • pivot (c4d.Vector) – The rotational velocity.

Raises

IndexError – If the index is out of range : 0<=index<GetCount().

FieldOutputBlock.GetPivot(self, index)

Retrieve the rotational velocity (axe + magnitude) at specified index.

New in version R21.

Parameters

index (int) – The index in the array.

Raises

IndexError – If the index is out of range : 0<=index<GetCount().

Return type

c4d.Vector

Returns

The rotational velocity (axe + magnitude).

FieldOutputBlock.GetDeactivated(self, index)

Reads deactivated state at specified index.

Parameters

index (int) – The index in the array.

Raises

IndexError – If the index is out of range : 0<=index<GetCount().

Return type

bool

Returns

The deactivated state.

FieldOutputBlock.SetDeactivated(self, index, deact)

Writes deactivated state at specified index.

Parameters
  • index (int) – The index in the array.

  • deact (bool) – The deactivated state to set.

Raises

IndexError – If the index is out of range : 0<=index<GetCount().