c4d.modules.mograph.MoData¶
-
class
c4d.modules.mograph.
MoData
¶ See also
push_apart_effector.c4d, py_effector_random.c4d and py_effector_shape.c4d scene examples.
Methods Signatures
MoData.GetDirty(self[, mask]) |
Get dirty count. Can be used to check if something has changed. |
MoData.SetDirty(self[, mask]) |
Mark the data as dirty. |
MoData.Clear(self, reset) |
Clear the data in the arrays. |
MoData.Read(self, hf) |
Read the data from a hyper file. |
MoData.Write(self, hf) |
Write the data to a hyper file. |
MoData.GetMemorySize(self) |
Get the size of the data in bytes. |
MoData.SetCount(self, cnt) |
Set the length of the arrays. |
MoData.GetCount(self) |
Get the length of the arrays. |
MoData.GetArrayCount(self) |
Get the number of arrays. |
MoData.GetArrayDescID(self, index) |
Get the description ID for the specified array index. |
MoData.GetArrayID(self, index) |
Get the ID for the specified array index. |
MoData.GetArrayIndexType(self, index) |
Get the data type of the specified array. |
MoData.GetArrayType(self, id) |
Get the data type of the specified array. |
MoData.GetArrayIndex(self, id) |
Get the array index for the specified description ID. |
MoData.GetDataInstance(self, id) |
Get a pointer to the container for the specified array. |
MoData.GetDataIndexInstance(self, index) |
Get a pointer to the container for the specified array. |
MoData.GetData(self[, id]) |
Get a copy of the array’s container. |
MoData.AddArray(self, id[, name, ...]) |
Add the specified array. |
MoData.RemoveArray(self, id) |
Remove the specified array. |
MoData.SetName(self, id, name) |
Set the name for the specified array. |
MoData.GetName(self, id) |
Get the name of the specified array. |
MoData.SetIndexName(self, index, name) |
Set the name for the specified array. |
MoData.GetIndexName(self, index) |
Get the name of the specified array. |
MoData.GetArray(self, id) |
Get an array. |
MoData.SetArray(self, id, arr, ...) |
Set an array. |
MoData.Flush(self) |
Flushes the data.
|
MoData.SetOffset(self[, offset]) |
Set an offset from the beginning of the arrays, for example array[0] becomes array[offset]. |
MoData.SetLimit(self[, limit]) |
Limits the array. All data are kept internally.
|
MoData.GetGenerator(self) |
Returns the generator. |
MoData.GetFalloffs(self) |
Returns the established falloffs. |
MoData.GetCurrentIndex(self) |
Returns the current index. |
MoData.GetBlendID(self) |
Returns the current blend ID. |
Methods Documentation
-
MoData.
GetDirty
(self, mask=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
(self, mask=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
(self, reset)¶ Clear the data in the arrays.
Parameters: reset (bool) – True will fill the arrays with their default values.
-
MoData.
Read
(self, 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
(self, 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
(self)¶ Get the size of the data in bytes.
Return type: int Returns: Size of the data.
-
MoData.
SetCount
(self, 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
(self)¶ Get the length of the arrays.
Return type: int Returns: The length of the arrays.
-
MoData.
GetArrayCount
(self)¶ Get the number of arrays.
Return type: int Returns: The number of arrays.
-
MoData.
GetArrayDescID
(self, 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
(self, 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
(self, 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
(self, 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
(self, 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
(self, 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
(self, 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
(self, 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
(self, 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
(self, 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
(self, 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
(self, 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
(self, 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
(self, 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
(self, 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
(self, 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
- id (int) –
-
MoData.
Flush
(self)¶ - Flushes the data.All data is cleared, the arrays are freed.
-
MoData.
SetOffset
(self, 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
(self, 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
(self)¶ Returns the generator.
New in version R14.014.
Note
In a Python Effector the variable gen is the generator.
Return type: c4d.BaseList2D Returns: The generator.
-
MoData.
GetFalloffs
(self)¶ Returns the established falloffs.
Note
Before R20, the falloffs was returned in reverse order.
Return type: list of float Returns: The falloff samples.
-
MoData.
GetCurrentIndex
(self)¶ Returns the current index.
Return type: int Returns: The current index.
-
MoData.
GetBlendID
(self)¶ Returns the current blend ID.
Return type: int Returns: The current blend ID.