c4d.modules.mograph.FieldOutputBlock

New in version R20.

Members

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

The deactivated state array.

Type: List[bool]

FieldOutputBlock.__init__()

Creates a FieldOutputBlock instance.

Return type:c4d.modules.mograph.FieldOutputBlock
Returns:The created FieldOutputBlock instance.
FieldOutputBlock.GetSubBlock()

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

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

FieldOutputBlock.GetCount()

Returns the number of elements in the sub-block.

Return type:int
Returns:The number of elements.
FieldOutputBlock.GetFullCount()

Returns the number of elements in the parent FieldOutput.

Return type:int
Returns:The full number of elements.
FieldOutputBlock.GetOffset()

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

Return type:int
Returns:The offset.
FieldOutputBlock.GetOwner()

Returns the parent or owner FieldOutput.

Return type:c4d.modules.mograph.FieldOutput
Returns:The owner.
FieldOutputBlock.IsValid()

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

Checks if the FieldOutputBlock is valid and non-empty.

Return type:bool
Returns:True if the FieldOutputBlock instance is populated, otherwise False.
FieldOutputBlock.CopyFrom(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(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(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(state=False)

Clears the deactivated array.

Parameters:state (bool) – The state the deactivated array should be cleared to.
FieldOutputBlock.CalculateCrc()

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(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(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(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(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(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(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(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(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(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(index, rotation)

Writes rotation at specified index.

Parameters:
  • index (int) – The index in the array.
  • rotation (c4d.Vector) – The rotation to set.
Raises:

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

FieldOutputBlock.GetDeactivated(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(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().