c4d.modules.mograph.FieldOutputBlock

class c4d.modules.mograph.FieldOutputBlock

New in version R20.

Attributes

c4d.modules.mograph.FieldOutputBlock._value

The weight value array.

Type: List[float]

c4d.modules.mograph.FieldOutputBlock._alpha

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

Type: List[float]

c4d.modules.mograph.FieldOutputBlock._color

The color array.

Type: List[c4d.Vector]

c4d.modules.mograph.FieldOutputBlock._direction

The slope direction array.

Type: List[c4d.Vector]

c4d.modules.mograph.FieldOutputBlock._rotation

The rotational velocity array.

Type: List[c4d.Vector]

c4d.modules.mograph.FieldOutputBlock._pivot

The rotational velocity (axe + magnitude)

Type: List[c4d.Vector]

c4d.modules.mograph.FieldOutputBlock._deactivated

The deactivated state array.

Type: List[bool]

Overview

Copying And Integrity

FieldOutputBlock.CalculateCrc()

Calculates a Crc on all internal data.

FieldOutputBlock.CopyArrayContentFrom()

Copies from src array content.

FieldOutputBlock.CopyFrom()

Copies from FieldOutputBlock src.

Layout And Ownership

FieldOutputBlock.GetCount()

Returns the number of elements in the sub-block.

FieldOutputBlock.GetFullCount()

Returns the number of elements in the parent FieldOutput.

FieldOutputBlock.GetOffset()

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

FieldOutputBlock.GetOwner()

Returns the parent or owner FieldOutput.

FieldOutputBlock.GetSubBlock()

Gets a sub-section of the sampling arrays.

Magic Methods

FieldOutputBlock.__init__()

Creates a FieldOutputBlock instance.

Sample Values

FieldOutputBlock.GetAlpha()

Reads alpha at specified index.

FieldOutputBlock.GetColor()

Reads color at specified index.

FieldOutputBlock.GetValue()

Reads value at specified index.

FieldOutputBlock.SetAlpha()

Writes alpha at specified index.

FieldOutputBlock.SetColor()

Writes color at specified index.

FieldOutputBlock.SetValue()

Writes value at specified index.

Spatial Attributes

FieldOutputBlock.GetDirection()

Reads direction at specified index.

FieldOutputBlock.GetPivot()

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

FieldOutputBlock.GetRotation()

Reads rotation at specified index.

FieldOutputBlock.SetDirection()

Writes direction at specified index.

FieldOutputBlock.SetRotation()

Writes rotation at specified index.

State Management

FieldOutputBlock.ClearDeactivated()

Clears the deactivated array.

FieldOutputBlock.ClearMemory()

Resets the sampling data to default values.

FieldOutputBlock.GetDeactivated()

Reads deactivated state at specified index.

FieldOutputBlock.IsPopulated()

Checks if the FieldOutputBlock is valid and non-empty.

FieldOutputBlock.IsValid()

Checks if the FieldOutputBlock instance allocations and sizes are valid.

FieldOutputBlock.Reset()

Resets the FieldOutputBlock instance to an empty state.

FieldOutputBlock.SetDeactivated()

Writes deactivated state at specified index.

Members

Copying And Integrity

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

Layout And Ownership

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

Magic Methods

FieldOutputBlock.__init__(self)

Creates a FieldOutputBlock instance.

Sample Values

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

Spatial Attributes

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

State Management

FieldOutputBlock.ClearDeactivated(self, state=False)

Clears the deactivated array.

Parameters

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

FieldOutputBlock.ClearMemory(self, startIdx=0, count=<function FieldOutputBlock.GetCount at 0x0000012ED4B15750>, 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.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.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.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.Reset(self)

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

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