c4d.modules.mograph.MoData
¶
See also
push_apart_effector.c4d , py_effector.c4d and python_effector.c4d scene examples.
c4d.modules.mograph.
MoData
¶
MoData.
GetDirty
(
[
mask=DIRTYFLAGS_0
]
)
¶
Get dirty count. Can be used to check if something has changed.
Parameters: |
mask
(
int
) –
Flags:
|
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | int | ||||||||||||||||||
Returns: | Dirty count. |
MoData.
SetDirty
(
[
mask=DIRTYFLAGS_0
]
)
¶
Mark the data as dirty.
Parameters: |
mask
(
int
) –
Flags:
|
---|
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.
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:
|
MoData.
GetArrayType
(
id
)
¶
Get the data type of the specified array.
Parameters: |
id
(
int
) –
The ID of the array:
|
---|
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:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | c4d.BaseContainer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns: | The array’s container. |
MoData.
AddArray
(
id[, name=”“][, default_flags=0]
)
¶
Add the specified array.
Parameters: |
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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: |
|
---|
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: |
|
---|---|
Raises: |
IndexError
– If the array
index
is out of range :
0<=index<
|
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:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | list | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns: | The array. |
MoData.
SetArray
(
id
,
arr
,
apply_strength
)
¶
Set an array.
Parameters: |
|
---|
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. |