c4d.modules.mograph¶
-
class
c4d.modules.
mograph
¶
Note
By default, for legacy reason, an effector added programmatically to the scene will use the falloff option. To switch that effector to fields, the effector need to receive a message MSG_MENUPREPARE. This message can be sent with field.Message(c4d.MSG_MENUPREPARE, currentDoc);
Attributes
-
FIELD_EXECUTION_BLOCK_SIZEf
¶ - The size of a block that’s executed in an MP environment.For single depth execution a value closer to 1200 is actually more optimal, with one group 600 and from then on for each group depth you can expect a drop of a third.For general usage on current architectures this gives the best balance.
Type: Float
Types¶
Functions Signatures
Returns the MoGraph data of an object. |
|
Retrieves the MoGraph clones selection. |
|
Sets the MoGraph clones selection. |
|
Retrieves the MoGraph clones weights. |
|
Sets the MoGraph clones weights. |
|
Get the default value for the specified |
|
Get the default value for the specified |
GetGenerator()¶
To get the generator (cloner, matrix object, text object, instance object, fracture object) that owns the MoData
currently being modified in a Python effector, see Python Effector Object Manual.
Functions Documentation
-
c4d.modules.mograph.
GeGetMoData
(op)¶ Returns the MoGraph data of an object.
- Parameters
op (c4d.BaseObject) – The object.
- Return type
- Returns
The MoGraph data.
-
c4d.modules.mograph.
GeGetMoDataSelection
(op)¶ Retrieves the MoGraph clones selection.
New in version R18.020.
- Parameters
op (c4d.BaseList2D) – Can be either a MoGraph Selection tag BaseTag(c4d.Tmgselection) or an object with a MoGraph Selection tag.
- Return type
- Returns
The clones selection.
-
c4d.modules.mograph.
GeSetMoDataSelection
(op, selection)¶ Sets the MoGraph clones selection.
New in version R18.039.
Warning
Before R21, makes sure to callC4DAtom.SetDirty()
after any usage of this method to properly updates the mograph object.In R21 this bug was fixed so the next code is no more needed.# mographObject is the host mograph object of the MoGraph Selection tag: BaseTag(c4d.Tmgselection). mographObject.SetDirty(c4d.DIRTYFLAGS_DATA) mographObject.Message(c4d.MSG_UPDATE)
- Parameters
op (c4d.BaseList2D) – Can be either a MoGraph Selection tag BaseTag(c4d.Tmgselection) or an object with a MoGraph Selection tag.
selection (c4d.BaseSelect) – The clones selection to set.
- Return type
bool
- Returns
True if successful, otherwise False.
-
c4d.modules.mograph.
GeGetMoDataWeights
(op)¶ Retrieves the MoGraph clones weights.
New in version R18.020.
- Parameters
op (c4d.BaseList2D) – Can be either a MoGraph Weightmap tag BaseTag(c4d.Tmgweight) or an object with a MoGraph Weightmap tag.
- Return type
List[float]
- Returns
The clones weights.
-
c4d.modules.mograph.
GeSetMoDataWeights
(op, weights)¶ Sets the MoGraph clones weights.
New in version R18.039.
Warning
Before R21, makes sure to call
C4DAtom.SetDirty()
after any usage of this method to properly updates the mograph object. In R21 this bug was fixed so the next code is no more needed.# mographObject is the host mograph object of the MoGraph Weight tag: BaseTag(c4d.Tmgweight). # moSelTag is a BaseTag(c4d.Tmgweight) moSelTag.SetDirty(c4d.DIRTYFLAGS_DATA) mographObject.SetDirty(c4d.DIRTYFLAGS_DATA) mographObject.Message(c4d.MSG_UPDATE)
- Parameters
op (c4d.BaseList2D) – Can be either a MoGraph Weight tag BaseTag(c4d.Tmgweight) or an object with a MoGraph Weight tag.
weights (List[float]) – The clones weights to set.
- Return type
bool
- Returns
True if successful, otherwise False.
-
c4d.modules.mograph.
GetMoDataDefault
(id)¶ Get the default value for the specified
MoData
ID.- Parameters
id (int) –
The
MoData
ID:MODATA_MATRIX
Matrix of the clone.
MODATA_COLOR
Color of the clone.
MODATA_SIZE
Size of the clone.
MODATA_UVW
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
Previous frame particle matrix.
MODATA_STARTMAT
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
Any
- Returns
The default value.
-
c4d.modules.mograph.
GetMoDataDefaultType
(id)¶ Get the default value for the specified
MoData
ID.- Parameters
id (int) –
The
MoData
ID:MODATA_MATRIX
Matrix of the clone.
MODATA_COLOR
Color of the clone.
MODATA_SIZE
Size of the clone.
MODATA_UVW
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
Previous frame particle matrix.
MODATA_STARTMAT
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
int
- Returns
The default type:
MD_TYPE_MD_NONE
None.
MD_TYPE_MD_CHAR
Char type.
MD_TYPE_MD_UCHAR
UChar type.
MD_TYPE_MD_LONG
Int32 type.
MD_TYPE_MD_ULONG
UInt32 type.
MD_TYPE_MD_LLONG
Int64 type.
MD_TYPE_MD_MATRIX
Matrix
type.MD_TYPE_MD_COLOR
Vector
type.MD_TYPE_MD_VECTOR
Vector
type.MD_TYPE_MD_NORMAL
Normal type.
MD_TYPE_MD_REAL
Float type.
MD_TYPE_MD_BOOL
Bool type.