c4d.modules.mograph.MoData

Members

MoData.GetDirty(mask=c4d.MDDIRTY_NONE)

Get dirty count. Can be used to check if something has changed.

Parameters:mask (int) –

Flags:

MDDIRTY_NONE None.
MDDIRTY_ALL Check all.
MDDIRTY_ARRAYCOUNT Array count itself changed (number of different arrays rather than length of arrays).
MDDIRTY_COUNT Length of the arrays changed.
MDDIRTY_DATA Data in the arrays changed, must be manually set.
Return type:int
Returns:Dirty count.
MoData.SetDirty(mask=c4d.MDDIRTY_NONE)

Mark the data as dirty.

Parameters:mask (int) –

Flags:

MDDIRTY_NONE None.
MDDIRTY_ALL Check all.
MDDIRTY_ARRAYCOUNT Array count itself changed (number of different arrays rather than length of arrays).
MDDIRTY_COUNT Length of the arrays changed.
MDDIRTY_DATA Data in the arrays changed, must be manually set.
MoData.Clear(reset)

Clear the data in the arrays.

Parameters:reset (bool) – True will fill the arrays with their default values.
MoData.Read(hf)

Read the data from a hyper file.

Parameters:hf (c4d.storage.HyperFile) – The hyper file to read from.
Return type:bool
Returns:True if the data was read, otherwise False.
MoData.Write(hf)

Write the data to a hyper file.

Parameters:hf (c4d.storage.HyperFile) – The hyper file to write to.
Return type:bool
Returns:True if the data was written, otherwise False.
MoData.GetMemorySize()

Get the size of the data in bytes.

Return type:int
Returns:Size of the data.
MoData.SetCount(cnt)

Set the length of the arrays.

Parameters:cnt (int) – The new length of the arrays.
Return type:bool
Returns:True if the length was set, otherwise False.
MoData.GetCount()

Get the length of the arrays.

Return type:int
Returns:The length of the arrays.
MoData.GetArrayCount()

Get the number of arrays.

Return type:int
Returns:The number of arrays.
MoData.GetArrayDescID(index)

Get the description ID for the specified array index.

Parameters:index (int) – The index of the array.
Raises:IndexError – If the array index is out of range : 0<=index<GetArrayCount().
Return type:c4d.DescID
Returns:The description ID.
MoData.GetArrayID(index)

Get the ID for the specified array index.

Parameters:index (int) – The index of the array.
Raises:IndexError – If the array index is out of range : 0<=index<GetArrayCount().
Return type:int
Returns:The retrieved ID:
MODATA_MATRIX Matrix Matrix of the clone.
MODATA_COLOR Vector Color of the clone.
MODATA_SIZE Vector Size of the clone.
MODATA_UVW Vector UV position of the clone.
MODATA_FLAGS int Flags:
  MOGENFLAG_CLONE_ON Particle is visible.
  MOGENFLAG_DISABLE Particle is permanently disabled.
  MOGENFLAG_BORN Particle is just generated (internal use only).
  MOGENFLAG_MODATASET The MoData has been set and does not need the input of the transform panel.
  MOGENFLAG_COLORSET The MoData color has been set and does not need to be updated.
  MOGENFLAG_TIMESET The MoData time has been set and does not need to be updated.
MODATA_WEIGHT float Weight of the clone.
MODATA_CLONE float Clone Offset (picks which child of the Cloner gets cloned or the blending between those children).
MODATA_TIME float Time offset of the clone.
MODATA_LASTMAT Matrix Previous frame particle matrix.
MODATA_STARTMAT Matrix Matrix at the particle’s birth.
MODATA_ALT_INDEX int Alternative index value that can be used for instance by the Step Effector when cloned over a spline with an offset.
MODATA_FALLOFF_WGT float Falloff weight.
MODATA_SPLINE_SEGMENT int The segment index, mostly used with the MoSpline (currently unused).
MODATA_GROWTH float Offset of growth for the particle on the MoSpline (currently unused).
MoData.GetArrayIndexType(index)

Get the data type of the specified array.

Parameters:index (int) – The index of the array.
Raises:IndexError – If the array index is out of range : 0<=index<GetArrayCount().
Return type:int
Returns:Type:
DTYPE_NONE None.
DTYPE_CHILDREN Children.
DTYPE_GROUP Group.
DTYPE_COLOR Color.
DTYPE_SUBCONTAINER BaseContainer.
DTYPE_MULTIPLEDATA Multiple data entry.
DTYPE_TEXTURE Texture name.
DTYPE_BUTTON Button.
DTYPE_DYNAMIC GV dynamic.
DTYPE_SEPARATOR Separator.
DTYPE_STATICTEXT Static text.
DTYPE_POPUP Popup.
DTYPE_LONG Integer.
DTYPE_REAL Float.
DTYPE_TIME BaseTime.
DTYPE_VECTOR Vector.
DTYPE_MATRIX Matrix.
DTYPE_STRING String.
DTYPE_FILENAME String.
DTYPE_BASELISTLINK BaseList2D.
DTYPE_BOOL GV bool ID_GV_DATA_TYPE_BOOL.
DTYPE_NORMAL GV normal ID_GV_DATA_TYPE_NORMAL.
DTYPE_COLORA Color with Alpha.
DTYPE_VECTOR4D Vector with 4 components.
MoData.GetArrayType(id)

Get the data type of the specified array.

Parameters:id (int) –

The ID of the array:

MODATA_MATRIX Matrix Matrix of the clone.
MODATA_COLOR Vector Color of the clone.
MODATA_SIZE Vector Size of the clone.
MODATA_UVW Vector UV position of the clone.
MODATA_FLAGS int Flags:
  MOGENFLAG_CLONE_ON Particle is visible.
  MOGENFLAG_DISABLE Particle is permanently disabled.
  MOGENFLAG_BORN Particle is just generated (internal use only).
  MOGENFLAG_MODATASET The MoData has been set and does not need the input of the transform panel.
  MOGENFLAG_COLORSET The MoData color has been set and does not need to be updated.
  MOGENFLAG_TIMESET The MoData time has been set and does not need to be updated.
MODATA_WEIGHT float Weight of the clone.
MODATA_CLONE float Clone Offset (picks which child of the Cloner gets cloned or the blending between those children).
MODATA_TIME float Time offset of the clone.
MODATA_LASTMAT Matrix Previous frame particle matrix.
MODATA_STARTMAT Matrix Matrix at the particle’s birth.
MODATA_ALT_INDEX int Alternative index value that can be used for instance by the Step Effector when cloned over a spline with an offset.
MODATA_FALLOFF_WGT float Falloff weight.
MODATA_SPLINE_SEGMENT int The segment index, mostly used with the MoSpline (currently unused).
MODATA_GROWTH float Offset of growth for the particle on the MoSpline (currently unused).
MoData.GetArrayIndex(id)

Get the array index for the specified description ID.

Parameters:id (c4d.DescID) – The description ID.
Return type:long
Returns:The retrieved array index.
MoData.GetDataInstance(id)

Get a pointer to the container for the specified array.

Parameters:id (c4d.DescID) – The description ID of the array.
Return type:c4d.BaseContainer
Returns:The internal container.
MoData.GetDataIndexInstance(index)

Get a pointer to the container for the specified array.

Parameters:index (int) – The index of the array.
Raises:IndexError – If the array index is out of range : 0<=index<GetArrayCount().
Return type:c4d.BaseContainer
Returns:The internal container.
MoData.GetData(id=NOTOK)

Get a copy of the array’s container.

Parameters:id (int) –

The ID of the array:

MODATA_MATRIX Matrix Matrix of the clone.
MODATA_COLOR Vector Color of the clone.
MODATA_SIZE Vector Size of the clone.
MODATA_UVW Vector UV position of the clone.
MODATA_FLAGS int Flags:
  MOGENFLAG_CLONE_ON Particle is visible.
  MOGENFLAG_DISABLE Particle is permanently disabled.
  MOGENFLAG_BORN Particle is just generated (internal use only).
  MOGENFLAG_MODATASET The MoData has been set and does not need the input of the transform panel.
  MOGENFLAG_COLORSET The MoData color has been set and does not need to be updated.
  MOGENFLAG_TIMESET The MoData time has been set and does not need to be updated.
MODATA_WEIGHT float Weight of the clone.
MODATA_CLONE float Clone Offset (picks which child of the Cloner gets cloned or the blending between those children).
MODATA_TIME float Time offset of the clone.
MODATA_LASTMAT Matrix Previous frame particle matrix.
MODATA_STARTMAT Matrix Matrix at the particle’s birth.
MODATA_ALT_INDEX int Alternative index value that can be used for instance by the Step Effector when cloned over a spline with an offset.
MODATA_FALLOFF_WGT float Falloff weight.
MODATA_SPLINE_SEGMENT int The segment index, mostly used with the MoSpline (currently unused).
MODATA_GROWTH float Offset of growth for the particle on the MoSpline (currently unused).
Return type:c4d.BaseContainer
Returns:The array’s container.
MoData.AddArray(id, name="", default_flags=0)

Add the specified array.

Parameters:
  • id (c4d.DescID) – The description ID of the array.
  • name (str) – The name of the array.
  • default_flags (int) –

    Default flags:

    MOGENFLAG_CLONE_ON Particle is visible.
    MOGENFLAG_DISABLE Particle is permanently disabled.
    MOGENFLAG_BORN Particle is just generated (internal use only).
    MOGENFLAG_MODATASET The MoData has been set and does not need the input of the transform panel.
    MOGENFLAG_COLORSET The MoData color has been set and does not need to be updated.
    MOGENFLAG_TIMESET The MoData time has been set and does not need to be updated.
Return type:

int

Returns:

The index of the added array or NOTOK if it failed.

MoData.RemoveArray(id)

Remove the specified array.

Parameters:id (c4d.DescID) – The description ID of the array.
Return type:bool
Returns:True if the array has been removed, otherwise False.
MoData.SetName(id, name)

Set the name for the specified array.

Parameters:
  • id (c4d.DescID) – The description ID of the array.
  • name (str) – The new name of the array.
MoData.GetName(id)

Get the name of the specified array.

Parameters:id (c4d.DescID) – The description ID of the array.
Return type:str
Returns:The name of the array.
MoData.SetIndexName(index, name)

Set the name for the specified array.

Parameters:
  • index (int) – The index of the array.
  • name (str) – The new name of the array.
Raises:

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

MoData.GetIndexName(index)

Get the name of the specified array.

Parameters:index (int) – Array index.
Raises:IndexError – If the array index is out of range : 0<=index<GetArrayCount().
Return type:str
Returns:The name of the array.
MoData.GetArray(id)

Get an array.

Parameters:id (int) –

The ID of the array:

MODATA_MATRIX Matrix Matrix of the clone.
MODATA_COLOR Vector Color of the clone.
MODATA_SIZE Vector Size of the clone.
MODATA_UVW Vector UV position of the clone.
MODATA_FLAGS int Flags:
  MOGENFLAG_CLONE_ON Particle is visible.
  MOGENFLAG_DISABLE Particle is permanently disabled.
  MOGENFLAG_BORN Particle is just generated (internal use only).
  MOGENFLAG_MODATASET The MoData has been set and does not need the input of the transform panel.
  MOGENFLAG_COLORSET The MoData color has been set and does not need to be updated.
  MOGENFLAG_TIMESET The MoData time has been set and does not need to be updated.
MODATA_WEIGHT float Weight of the clone.
MODATA_CLONE float Clone Offset (picks which child of the Cloner gets cloned or the blending between those children).
MODATA_TIME float Time offset of the clone.
MODATA_LASTMAT Matrix Previous frame particle matrix.
MODATA_STARTMAT Matrix Matrix at the particle’s birth.
MODATA_ALT_INDEX int Alternative index value that can be used for instance by the Step Effector when cloned over a spline with an offset.
MODATA_FALLOFF_WGT float Falloff weight.
MODATA_SPLINE_SEGMENT int The segment index, mostly used with the MoSpline (currently unused).
MODATA_GROWTH float Offset of growth for the particle on the MoSpline (currently unused).
Return type:list
Returns:The array.
MoData.SetArray(id, arr, apply_strength)

Set an array.

Parameters:
  • id (int) –

    The ID of the array:

    MODATA_MATRIX Matrix Matrix of the clone.
    MODATA_COLOR Vector Color of the clone.
    MODATA_SIZE Vector Size of the clone.
    MODATA_UVW Vector UV position of the clone.
    MODATA_FLAGS int Flags:
      MOGENFLAG_CLONE_ON Particle is visible.
      MOGENFLAG_DISABLE Particle is permanently disabled.
      MOGENFLAG_BORN Particle is just generated (internal use only).
      MOGENFLAG_MODATASET The MoData has been set and does not need the input of the transform panel.
      MOGENFLAG_COLORSET The MoData color has been set and does not need to be updated.
      MOGENFLAG_TIMESET The MoData time has been set and does not need to be updated.
    MODATA_WEIGHT float Weight of the clone.
    MODATA_CLONE float Clone Offset (picks which child of the Cloner gets cloned or the blending between those children).
    MODATA_TIME float Time offset of the clone.
    MODATA_LASTMAT Matrix Previous frame particle matrix.
    MODATA_STARTMAT Matrix Matrix at the particle’s birth.
    MODATA_ALT_INDEX int Alternative index value that can be used for instance by the Step Effector when cloned over a spline with an offset.
    MODATA_FALLOFF_WGT float Falloff weight.
    MODATA_SPLINE_SEGMENT int The segment index, mostly used with the MoSpline (currently unused).
    MODATA_GROWTH float Offset of growth for the particle on the MoSpline (currently unused).
  • arr (list) – The array.
  • apply_strength (bool) – If True, a falloff must be present in the MoData instance
MoData.Flush()

Flushes the data. All data is cleared, the arrays are freed.

MoData.SetOffset(offset=0)

Set an offset from the beginning of the arrays, for example array[0] becomes array[offset].

Parameters:offset (int) – The array offset, 0 <= offset < GetCount().
MoData.SetLimit(limit=NOTOK)

Limits the array. All data are kept internally. Can be useful for certain cases for instance merging.

Parameters:limit (int) – The array limit, 0 <= limit < GetCount().
MoData.GetGenerator()

New in version R14.014.

Returns the generator.

Note

In a Python Effector the variable gen is the generator.

Return type:c4d.BaseList2D
Returns:The generator.
MoData.GetFalloffs()

Returns the established falloffs.

Note

The falloffs are returned in reverse order.

Return type:list of float
Returns:The falloff samples.
MoData.GetCurrentIndex()

Returns the current index.

Return type:int
Returns:The current index.
MoData.GetBlendID()

Returns the current blend ID.

Return type:int
Returns:The current blend ID.