c4d.modules.mograph¶
-
class
c4d.modules.mograph¶
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
c4d.modules.mograph.GeGetMoData(op) |
Returns the MoGraph data of an object. |
c4d.modules.mograph.GeGetMoDataSelection(op) |
Retrieves the MoGraph clones selection. |
c4d.modules.mograph.GeSetMoDataSelection(op, selection) |
Sets the MoGraph clones selection. |
c4d.modules.mograph.GeGetMoDataWeights(op) |
Retrieves the MoGraph clones weights. |
c4d.modules.mograph.GeSetMoDataWeights(op, weights) |
Sets the MoGraph clones weights. |
c4d.modules.mograph.GetMoDataDefault(id) |
Get the default value for the specified MoData ID. |
c4d.modules.mograph.GetMoDataDefaultType(id) |
Get the default value for the specified MoData ID. |
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.
Functions Documentation
-
c4d.modules.mograph.GeGetMoData(op)¶ Returns the MoGraph data of an object.
Parameters: op (c4d.BaseObject) – The object. Return type: MoDataReturns: 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: c4d.BaseSelectReturns: 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 of 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 of 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
MoDataID.Parameters: id (int) – The
MoDataID:MODATA_MATRIX MatrixMatrix of the clone. MODATA_COLOR VectorColor of the clone. MODATA_SIZE VectorSize of the clone. MODATA_UVW VectorUV 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 MoDatahas been set and does not need the input of the transform panel.MOGENFLAG_COLORSET The MoDatacolor has been set and does not need to be updated.MOGENFLAG_TIMESET The MoDatatime 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 MatrixPrevious frame particle matrix. MODATA_STARTMAT MatrixMatrix 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
MoDataID.Parameters: id (int) – The
MoDataID:MODATA_MATRIX MatrixMatrix of the clone. MODATA_COLOR VectorColor of the clone. MODATA_SIZE VectorSize of the clone. MODATA_UVW VectorUV 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 MoDatahas been set and does not need the input of the transform panel.MOGENFLAG_COLORSET The MoDatacolor has been set and does not need to be updated.MOGENFLAG_TIMESET The MoDatatime 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 MatrixPrevious frame particle matrix. MODATA_STARTMAT MatrixMatrix 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_NONE None. MD_CHAR Char type. MD_UCHAR UChar type. MD_LONG Int32 type. MD_ULONG UInt32 type. MD_LLONG Int64 type. MD_MATRIX Matrixtype.MD_COLOR Vectortype.MD_VECTOR Vectortype.MD_NORMAL Normal type. MD_REAL Float type. MD_BOOL Bool type.