EffectorData Class Reference

#include <c4d_baseeffectordata.h>

Inheritance diagram for EffectorData:

Detailed Description

A data class for creating effector plugins.
Effectors are objects that modifies motion data particles in the MoGraph module, and uses the same controls for deformation. (Effectors cannot run without the MoGraph module.)

Note
Effectors are executed by messaging them MSG_EXECUTE_EFFECTOR and passing an Effector_PassData structure. Use RegisterEffectorPlugin() to register an effector plugin.

Public Attributes

maxon::BaseRef< EffectorDataParameters, maxon::DeepConstnessPointerHandleredata
 

Inherited from NodeData/ObjectData

virtual Bool Init (GeListNode *node, Bool isCloneInit)
 
virtual void Free (GeListNode *node)
 
virtual Bool GetDDescription (const GeListNode *node, Description *description, DESCFLAGS_DESC &flags) const
 
virtual DRAWRESULT Draw (BaseObject *op, DRAWPASS drawpass, BaseDraw *bd, BaseDrawHelp *bh)
 
virtual void GetDimension (const BaseObject *op, Vector *mp, Vector *rad) const
 
virtual Bool AddToExecution (BaseObject *op, PriorityList *list) final
 
virtual EXECUTIONRESULT Execute (BaseObject *op, BaseDocument *doc, BaseThread *bt, Int32 priority, EXECUTIONFLAGS flags)
 
virtual Bool ModifyObject (const BaseObject *mod, const BaseDocument *doc, BaseObject *op, const Matrix &op_mg, const Matrix &mod_mg, Float lod, Int32 flags, BaseThread *thread) const
 
virtual maxon::Result< BoolGetAccessedObjects (const BaseList2D *node, METHOD_ID method, AccessedObjectsCallback &access) const
 
virtual Bool Message (GeListNode *node, Int32 type, void *t_data)
 
virtual Int32 GetHandleCount (const BaseObject *op) const
 
virtual void GetHandle (BaseObject *op, Int32 i, HandleInfo &info)
 
virtual void SetHandle (BaseObject *op, Int32 i, Vector p, const HandleInfo &info)
 
virtual Bool CopyTo (NodeData *dest, const GeListNode *snode, GeListNode *dnode, COPYFLAGS flags, AliasTrans *trn) const
 
virtual Bool IsInstanceOf (const GeListNode *node, Int32 type) const
 
virtual Bool GetDEnabling (const GeListNode *node, const DescID &id, const GeData &t_data, DESCFLAGS_ENABLE flags, const BaseContainer *itemdesc) const
 

Effector

virtual Bool InitEffector (GeListNode *node, Bool isCloneInit)
 
virtual void FreeEffector (GeListNode *node)
 
C4D_FalloffGetFalloff ()
 
const C4D_FalloffGetFalloff () const
 
void AddEffectorDependence (const BaseObject *op) const
 
virtual Int32 GetEffectorFlags () const
 
virtual Bool ModifyDDescription (const GeListNode *node, Description *description, AtomArray *ar) const
 
virtual Bool ExecuteEffector (const BaseObject *op, const BaseDocument *doc, const BaseObject *gen, EffectorDataStruct &data, MoData *md, Float strength, BaseThread *thread) const
 
virtual maxon::Result< maxon::GenericDataInitPoints (const BaseObject *op, const BaseObject *gen, const BaseDocument *doc, const EffectorDataStruct &data, MoData *md, BaseThread *thread) const
 
virtual void ModifyPoints (const BaseObject *op, const BaseObject *gen, const BaseDocument *doc, const EffectorDataStruct &data, const maxon::GenericData &extraData, MutableEffectorDataStruct &mdata, MoData *md, BaseThread *thread) const
 
virtual void CalcPlacebo (const BaseObject *op, const BaseObject *gen, const BaseDocument *doc, const EffectorDataStruct &data, const maxon::GenericData &extraData, MutableEffectorDataStruct &mdata, Int32 index, MoData *md, const Vector &globalpos, Float fall_weight) const
 
virtual void CalcPointValue (const BaseObject *op, const BaseObject *gen, const BaseDocument *doc, const EffectorDataStruct &data, const maxon::GenericData &extraData, MutableEffectorDataStruct &mdata, Int32 index, MoData *md, const Vector &globalpos, Float fall_weight) const
 
virtual Vector CalcPointColor (const BaseObject *op, const BaseObject *gen, const BaseDocument *doc, const EffectorDataStruct &data, const maxon::GenericData &extraData, const MutableEffectorDataStruct &mdata, Int32 index, MoData *md, const Vector &globalpos, Float fall_weight) const
 
Bool CalcFields (const BaseDocument *doc, const BaseObject *generatorObject, MoData *md, FIELDSAMPLE_FLAG flags, FieldOutput &result) const
 
static maxon::Result< BoolGetAccessedObjectsEffectorBase (const BaseList2D *node, METHOD_ID method, AccessedObjectsCallback &access, ACCESSED_OBJECTS_MASK ensureReadable=ACCESSED_OBJECTS_MASK(0))
 

Additional Inherited Members

- Public Member Functions inherited from ObjectData
virtual void CheckDirty (BaseObject *op, const BaseDocument *doc)
 
virtual DRAWRESULT DrawShadow (BaseObject *op, BaseDraw *bd, BaseDrawHelp *bh)
 
virtual Int32 DetectHandle (BaseObject *op, BaseDraw *bd, Int32 x, Int32 y, QUALIFIER qualifier)
 
virtual Bool MoveHandle (BaseObject *op, BaseObject *undo, const Vector &mouse_pos, Int32 hit_id, QUALIFIER qualifier, BaseDraw *bd)
 
virtual void GetModelingAxis (BaseObject *op, BaseDocument *doc, Matrix &axis)
 
virtual BaseObjectGetVirtualObjects (BaseObject *op, const HierarchyHelp *hh)
 
virtual SplineObjectGetContour (BaseObject *op, BaseDocument *doc, Float lod, BaseThread *bt)
 
virtual void ModifyParticles (BaseObject *op, Particle *pp, BaseParticle *ss, Int32 pcnt, Float diff)
 
- Public Member Functions inherited from NodeData
 NodeData ()
 
GeListNodeGet ()
 
const GeListNodeGet () const
 
virtual void GetBubbleHelp (GeListNode *node, maxon::String &str)
 
virtual const BaseDocumentGetDocument (const GeListNode *node) const
 
virtual maxon::Result< BoolGetBranchInfo (const GeListNode *node, const maxon::ValueReceiver< const BranchInfo & > &info, GETBRANCHINFO flags) const
 
virtual Bool IsDocumentRelated (const GeListNode *node, Bool &docrelated) const
 
virtual maxon::Result< maxon::GenericDataGroupChanges (BaseList2D *node)
 
virtual Bool Read (GeListNode *node, HyperFile *hf, Int32 level)
 
virtual Bool Write (const GeListNode *node, HyperFile *hf) const
 
virtual Bool GetDParameter (const GeListNode *node, const DescID &id, GeData &t_data, DESCFLAGS_GET &flags) const
 
virtual Bool SetDParameter (GeListNode *node, const DescID &id, const GeData &t_data, DESCFLAGS_SET &flags)
 
virtual Bool TranslateDescID (GeListNode *node, const DescID &id, DescID &res_id, C4DAtom *&res_at)
 
- Public Member Functions inherited from BaseData
virtual ~BaseData ()
 
void Destructor ()
 
- Static Public Member Functions inherited from ObjectData
static maxon::Result< BoolGetAccessedObjectsDeformerBase (const BaseList2D *node, const C4D_Falloff *falloff, METHOD_ID method, AccessedObjectsCallback &access, ACCESSED_OBJECTS_MASK modifyWrite=ACCESSED_OBJECTS_MASK(0))
 
- Protected Attributes inherited from NodeData
GeListNodeprivate_link
 

Member Function Documentation

◆ Init()

virtual Bool Init ( GeListNode node,
Bool  isCloneInit 
)
virtual

Called when a new instance of the node type is being allocated.

The parameters of a node must be initialized in this method. NodeData::Init is being called frequently due to nodes being reallocated in the background by Cinema 4D. One should therefore be careful with carrying out computationally complex tasks in this function.

Bool BlinkerKey::Init(GeListNode* node, Bool isCloneInit)
{
BaseKey* op = (BaseKey*) node;
BaseContainer& data = op->GetDataInstanceRef();
data.SetFloat(BLINKERKEY_NUMBER, 1.0);
data.SetFloat(BLINKERKEY_STRENGTH, 1.0);
data.SetBool(BLINKERKEY_SOFT, false);
return true;
}
Definition: c4d_basecontainer.h:48
void SetFloat(Int32 id, Float r)
Definition: c4d_basecontainer.h:615
void SetBool(Int32 id, Bool b)
Definition: c4d_basecontainer.h:580
Represents a C4DAtom that resides in a 4D list.
Definition: c4d_baselist.h:1975
maxon::Bool Bool
Definition: ge_sys_math.h:51
PyObject * op
Definition: object.h:520
Definition: node.h:10
Note
If the node data class has a constructor it is called as usual before, but at that time there is no GeListNode link established.
Parameters
[in]nodeThe GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
Returns
true if the node was initialized, otherwise false.

Reimplemented from NodeData.

◆ Free()

virtual void Free ( GeListNode node)
virtual

Called when a node data instance is deallocated.
Deallocate member variables of the node data class here.

Note
If the node data class has a destructor it is called as usual after.
Parameters
[in]nodeThe GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.

Reimplemented from NodeData.

◆ GetDDescription()

virtual Bool GetDDescription ( const GeListNode node,
Description description,
DESCFLAGS_DESC flags 
) const
virtual

Called to add parameters to the description for the node.
Modify the passed description as needed, set the appropriate flags. Make sure to include a call to the parent at the end.

Note
{The SUPER syntax is only available when the INSTANCEOF macro has been invoked for the NodeData which contains the NodeData::GetDDescription implementation.}
return SUPER::GetDDescription(data, description, flags, parentdescription);
PyCompilerFlags * flags
Definition: ast.h:14
If only a description resource is used it is not needed to overload GetDDescription.
Parameters
[in]nodeThe GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in,out]descriptionThe node's description to add the parameters to. Cinema 4D owns the pointed description.
[in,out]flagsThe flags for the description operation: DESCFLAGS_DESC
Returns
true if successful, otherwise false. It is recommended to include a call to the parent function as last return.

Reimplemented from NodeData.

◆ Draw()

virtual DRAWRESULT Draw ( BaseObject op,
DRAWPASS  drawpass,
BaseDraw bd,
BaseDrawHelp bh 
)
virtual

Called to draw additional information for the object in the editor view.
Be sure to call the parent version as last return:

return SUPER::Draw(op, drawpass, bd, bh);
Note
Generator objects are automatically drawn as GetVirtualObjects() returns the polygonal data already.
Warning
Only draw in DRAWPASS::HIGHLIGHTS if you really know what you are doing. Otherwise always check the drawpass and then do not draw if it is DRAWPASS::HIGHLIGHTS::
Only draw the object in DRAWPASS::OBJECT. The object's appearance may change if the same object is drawn in multiple passes.
Parameters
[in]opThe BaseObject connected with the ObjectData instance. Equal to static_cast<BaseObject*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed object.
[in]drawpassThe draw pass: DRAWPASS
[in]bdThe editor's view. The caller owns the pointed view.
[in]bhThe helper for the editor's view. The caller owns the pointed view helper.
Returns
The result of drawing into the editor view: DRAWRESULT

Reimplemented from ObjectData.

◆ GetDimension()

virtual void GetDimension ( const BaseObject op,
Vector mp,
Vector rad 
) const
virtual

Called to get the boundaries of the object.

Note
GetDimension() should be implemented for objects of types Opolygon, Opoint, Oline and Ospline. Furthermore it may be implemented to override Cinema 4D's default handling of bounding boxes.
Parameters
[in]opThe BaseObject connected with the ObjectData instance. Equal to static_cast<BaseObject*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed object.
[out]mpAssign the center point of the bounding box.
[out]radAssign the XYZ bounding box radius.

Reimplemented from ObjectData.

◆ AddToExecution()

virtual Bool AddToExecution ( BaseObject op,
PriorityList list 
)
finalvirtual

Called to add execution priorities.
By default returns false. In that case Cinema 4D will call Execute() at the priority specified by the user in the EXPRESSION_PRIORITY parameter of the container.
If overridden then insert points of execution in the list and return true. Heres is an example:

#define EXECUTIONPRIORITY_ANIMATION
Animation.
Definition: ge_prepass.h:3883
#define EXECUTIONPRIORITY_GENERATOR
Generators.
Definition: ge_prepass.h:3887
PyWideStringList * list
Definition: initconfig.h:447

Cinema 4D will then call Execute() 2 times.

Parameters
[in]opThe BaseObject connected with the ObjectData instance. Equal to static_cast<BaseObject*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed object.
[in]listThe priority list to add execution points to. Cinema 4D owns the pointed priority list.
Returns
true if priority was added to the execution list, otherwise false.

Reimplemented from ObjectData.

◆ Execute()

virtual EXECUTIONRESULT Execute ( BaseObject op,
BaseDocument doc,
BaseThread bt,
Int32  priority,
EXECUTIONFLAGS  flags 
)
virtual

Called at the point in the priority pipeline specified by AddToExecution, or the lack thereof.

Note
This function is called in a thread context. See the important information about threading.
Parameters
[in]opThe BaseObject connected with the ObjectData instance. Equal to static_cast<BaseObject*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed object.
[in]docThe host document of the object. Cinema 4D owns the pointed document.
[in]btThe calling thread. Can be nullptr. Cinema 4D owns the pointed thread.
[in]priorityThe priority of the call to Execute() in the pipeline: EXECUTIONPRIORITY
[in]flagsThe execution flags: EXECUTIONFLAGS
Returns
The execution result: EXECUTIONRESULT

Reimplemented from ObjectData.

◆ ModifyObject()

virtual Bool ModifyObject ( const BaseObject mod,
const BaseDocument doc,
BaseObject op,
const Matrix op_mg,
const Matrix mod_mg,
Float  lod,
Int32  flags,
BaseThread thread 
) const
virtual

Called to modify the passed object.

Note
This function is called in a thread context. See the important information about threading.
Warning
Must not be overridden for non-modifier objects.
Parameters
[in]modThe BaseObject connected with the ObjectData instance. Equal to static_cast<BaseObject*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed object.
[in]docThe document containing the object to modify. Cinema 4D owns the pointed document.
[in,out]opThe object to modify. Cinema 4D owns the pointed object.
[in]op_mgThe object's world matrix.
[in]mod_mgThe modifier object's world matrix.
[in]lodThe level of detail.
[in]flagsCurrently unused.
[in]threadThe calling thread. Can be nullptr. Cinema 4D owns the pointed thread.
Returns
true if the object was modified, otherwise false.

Reimplemented from ObjectData.

◆ GetAccessedObjects()

virtual maxon::Result<Bool> GetAccessedObjects ( const BaseList2D node,
METHOD_ID  method,
AccessedObjectsCallback access 
) const
virtual

Reimplemented from NodeData.

◆ Message()

virtual Bool Message ( GeListNode node,
Int32  type,
void *  data 
)
virtual

Called when a node receives messages.

See also
C4DAtom::Message
Note
Some notification messages are automatically passed along to branches: MSG_POINTS_CHANGED, MSG_POLYGONS_CHANGED and MSG_SEGMENTS_CHANGED. This is for convenience and historical reasons.
Parameters
[in]nodeThe GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]typeThe message type: MSG
[in,out]dataThe message data. The sender owns the pointed data.
Returns
true or false depending on the message type.

Reimplemented from NodeData.

◆ GetHandleCount()

virtual Int32 GetHandleCount ( const BaseObject op) const
virtual

Called to get the number of handles the object has.
Part of the automated handle interface.

See also
HandleInfo.
Parameters
[in]opThe BaseObject connected with the ObjectData instance. Equal to static_cast<BaseObject*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed object.
Returns
The number of handles for the object.

Reimplemented from ObjectData.

◆ GetHandle()

virtual void GetHandle ( BaseObject op,
Int32  i,
HandleInfo info 
)
virtual

Called to get the information for handle i.
Part of the automated handle interface.

See also
HandleInfo.
Parameters
[in]opThe BaseObject connected with the ObjectData instance. Equal to static_cast<BaseObject*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed object.
[in]iThe handle index.
[in,out]infoFill with the handle information.

Reimplemented from ObjectData.

◆ SetHandle()

virtual void SetHandle ( BaseObject op,
Int32  i,
Vector  p,
const HandleInfo info 
)
virtual

Called to set the information for handle i.
Called when the user has moved handle i to position p. Update the object's internal data accordingly (e.g. parameter values etc.).
Part of the automated handle interface.

See also
HandleInfo.
Parameters
[in]opThe BaseObject connected with the ObjectData instance. Equal to static_cast<BaseObject*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed object.
[in]iThe handle index.
[in]pThe handle's position.
[in]infoThe handle information.

Reimplemented from ObjectData.

◆ CopyTo()

virtual Bool CopyTo ( NodeData dest,
const GeListNode snode,
GeListNode dnode,
COPYFLAGS  flags,
AliasTrans trn 
) const
virtual

Called when a node is duplicated.

Warning
If at least one of Read(), Write() and CopyTo() is implemented, it is recommended to implement all three, otherwise data might be lost.

Copy any member variable for the node plugin. Simply transfer from this to dest and/or snode to dnode:

MyNodeDataImplementation* destImpl = static_cast<MyNodeDataImplementation*>(dest);
destImpl->offset = offset;
destImpl->object_access = object_access;
Note
Init() is called for the destination node before.
Warning
It is recommended to store as much as possible in the node's container as Cinema 4D handles the copying of those values automatically. Only use member variables when necessary.
Parameters
[out]destThe destination node data. Cinema 4D owns the pointed node.
[in]snodeThe source node. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[out]dnodeThe destination node. Cinema 4D owns the pointed node.
[in]flagsThe copy flags: COPYFLAGS
[in]trnAn alias translator for the operation. Can be nullptr. The sender owns the pointed alias translator.
Returns
true if the node was copied, otherwise false.

Reimplemented from NodeData.

◆ IsInstanceOf()

virtual Bool IsInstanceOf ( const GeListNode node,
Int32  type 
) const
virtual

Called to check if the node is an instance of a base type.

See also
C4DAtom::IsInstanceOf.
Parameters
[in]nodeThe GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]typeThe type to check.
Returns
true if the node is an instance of the given type, otherwise false.

Reimplemented from NodeData.

◆ GetDEnabling()

virtual Bool GetDEnabling ( const GeListNode node,
const DescID id,
const GeData t_data,
DESCFLAGS_ENABLE  flags,
const BaseContainer itemdesc 
) const
virtual

Called to decide which description parameters should be enabled or disabled.
Can be used both for parameters that are stored in the node's description and for dynamic parameters.
Read the passed t_data if the right id was provided, and return true to enable the parameter or false to disable it. Make sure to include a call to the parent at the end.

Note
{The SUPER syntax is only available when the INSTANCEOF macro has been invoked for the NodeData which contains the NodeData::GetDEnabling implementation.}
return SUPER::GetDEnabling(data, id, t_data, flags, itemdesc);
Parameters
[in]nodeThe GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]idThe ID of the parameter.
[in]t_dataThe parameter data. Cinema 4D owns the pointed data.
[in]flagsNot used.
[in]itemdescThe parameter's description, encoded to a container as described in Description.
Returns
true if the parameter should be enabled, otherwise false. It is recommended to include a call to the parent function as last return.

Reimplemented from NodeData.

◆ InitEffector()

virtual Bool InitEffector ( GeListNode node,
Bool  isCloneInit 
)
virtual

Called to initialize the effector. Replacement NodeData::Init function for effectors.
Called when effector is first created.

Note
It is not needed to call SUPER::InitEffector()
Parameters
[in]nodeEqual to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
Returns
true if the node was initialized, otherwise false.

◆ FreeEffector()

virtual void FreeEffector ( GeListNode node)
virtual

Called to free the effector. Replacement NodeData::Free function for effectors.
Called when effector is deleted.

Note
It is not needed to call SUPER::FreeEffector()
Parameters
[in]nodeEqual to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.

◆ GetFalloff() [1/2]

C4D_Falloff* GetFalloff ( )

Gets the falloff of the effector, this may be null if the effector is using Fields instead, in which case make use of CalcFields.

Note
EFFECTORFLAGS_HASFALLOFF needs to be set.
Returns
The falloff.

◆ GetFalloff() [2/2]

const C4D_Falloff* GetFalloff ( ) const

Gets the falloff of the effector, this may be null if the effector is using Fields instead, in which case make use of CalcFields.

Note
EFFECTORFLAGS_HASFALLOFF needs to be set.
Returns
The falloff.

◆ AddEffectorDependence()

void AddEffectorDependence ( const BaseObject op) const

Adds a dependence on another object's dirty state to the effector.
This way if the other object becomes dirty then the effector will be forced to update.
Normally used in either ExecuteEffector or InitPoints. (See DropEffector SDK example.)

Parameters
[in]opThe object to add a dependency on. The caller owns the pointed object.

◆ GetEffectorFlags()

virtual Int32 GetEffectorFlags ( ) const
virtual

Called to get the effector flags.

Returns
The effectors flags: EFFECTORFLAGS

◆ ModifyDDescription()

virtual Bool ModifyDDescription ( const GeListNode node,
Description description,
AtomArray ar 
) const
virtual

Called to modify the description of the effector.
Convenience function so it is not needed to overload NodeData::GetDDescription to show/hide elements or change the description.

Parameters
[in]nodeEqual to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in,out]descriptionThe description to modify. Cinema 4D owns the pointed description.
[in]arThe atom array to pass along. Cinema 4D owns the pointed atom array.
Returns
true if successful, otherwise false.

◆ ExecuteEffector()

virtual Bool ExecuteEffector ( const BaseObject op,
const BaseDocument doc,
const BaseObject gen,
EffectorDataStruct data,
MoData md,
Float  strength,
BaseThread thread 
) const
virtual

Called to execute the effector.
Called first of all in the effector execution pipeline. Fill the EffectorDataStruct and call InitPoints().

Warning
Do not override unless strictly necessary.
Note
Needs to call SUPER::ExecuteEffector() as last return.
Parameters
[in]opThe effector object. Cinema 4D owns the pointed object.
[in]docThe document. Cinema 4D owns the pointed document.
[in]genThe object that owns the MoData (motion particle generator). Cinema 4D owns the pointed object.
Can sometimes be the same as the effector, mostly used for matrix, internally used to get MoData when no MoData is sent.
[in]mdThe motion data sent to the effector, may be nullptr. Cinema 4D owns the pointed motion data.
[in]strengthThe strength value.
[in]threadThe thread the effector is being executed in. Cinema 4D owns the pointed thread.
Returns
true if successful, otherwise false.

◆ InitPoints()

virtual maxon::Result<maxon::GenericData> InitPoints ( const BaseObject op,
const BaseObject gen,
const BaseDocument doc,
const EffectorDataStruct data,
MoData md,
BaseThread thread 
) const
virtual

Called to initialize the points/particles just before the effector body is calculated in ModifyPoints::
Allows to setup and retrieve any necessary data from the effector's container.

Parameters
[in]opThe effector object. Cinema 4D owns the pointed object.
[in]genThe object that owns the MoData (motion particle generator). Cinema 4D owns the pointed object.
Can sometimes be the same as the effector, mostly used for matrix, internally used to get MoData when no MoData is sent.
[in]docThe document. Cinema 4D owns the pointed document.
[in]dataThe effector's internal data, filled in. Cinema 4D owns the pointed data.
[in]mdThe MoData the effector will modify. Cinema 4D owns the pointed motion data.
[in]threadThe thread the effector is being executed in. Cinema 4D owns the pointed thread.

◆ ModifyPoints()

virtual void ModifyPoints ( const BaseObject op,
const BaseObject gen,
const BaseDocument doc,
const EffectorDataStruct data,
const maxon::GenericData extraData,
MutableEffectorDataStruct mdata,
MoData md,
BaseThread thread 
) const
virtual

Called to modify the MoData particles.
All falloff values should be evaluated if overridden using the falloff of the effector (retrieved with GetFalloff).
DropEffector SDK example shows how to overload ModifyPoints correctly.

Note
If overridden then CalcPlacebo(), CalcPointValue() and CalcPointColor() will not get called (unless the effector explicitly calls them).
Parameters
[in]opThe effector object. Cinema 4D owns the pointed object.
[in]genThe object that owns the MoData (motion particle generator). Cinema 4D owns the pointed object.
Can be sometimes the same as the effector, mostly used for matrix, internally used to get MoData when no MoData is sent.
[in]docThe document. Cinema 4D owns the pointed document.
[in]dataThe effector's internal data, filled in. Cinema 4D owns the pointed data.
[in]mdThe MoData the effector will modify. Cinema 4D owns the pointed motion data.
[in]threadThe thread the effector is being executed in. Cinema 4D owns the pointed thread.

◆ CalcPlacebo()

virtual void CalcPlacebo ( const BaseObject op,
const BaseObject gen,
const BaseDocument doc,
const EffectorDataStruct data,
const maxon::GenericData extraData,
MutableEffectorDataStruct mdata,
Int32  index,
MoData md,
const Vector globalpos,
Float  fall_weight 
) const
virtual

Called in a value driven effector for each point/particle that is not needed (where ModifyPoints has not been override).
Called when a MoData index should not be calculated/evaluated itself, but certain values may be needed to be incremented internally.
For instance if a "random" value is used, makes sure it is called the same number of times as particles (to avoid skipping/jumping around values).

Parameters
[in]opThe effector object. Cinema 4D owns the pointed object.
[in]genThe object that owns the MoData (motion particle generator). Cinema 4D owns the pointed object.
Can sometimes be the same as the effector, mostly used for matrix, internally used to get MoData when no MoData is sent.
[in]docThe document. Cinema 4D owns the pointed document.
[in]dataThe effector's internal data, filled in. Cinema 4D owns the pointed data.
[in]indexThe current point/particle index.
[in]mdThe MoData. Cinema 4D owns the pointed motion data.
[in]globalposThe global space position of the current point/particle.
[in]fall_weightThe falloff strength for the current particle.

◆ CalcPointValue()

virtual void CalcPointValue ( const BaseObject op,
const BaseObject gen,
const BaseDocument doc,
const EffectorDataStruct data,
const maxon::GenericData extraData,
MutableEffectorDataStruct mdata,
Int32  index,
MoData md,
const Vector globalpos,
Float  fall_weight 
) const
virtual

Called in a value driven effector for each point/particle that is needed (where ModifyPoints has not been override).
Assign the EffectorDataStruct's strengths (see NoiseEffector SDK example) to set the values that drive the effector.

Parameters
[in]opThe effector object. Cinema 4D owns the pointed object.
[in]genThe object that owns the MoData (motion particle generator). Cinema 4D owns the pointed object.
Can sometimes be the same as the effector, mostly used for matrix, internally used to get MoData when no MoData is sent.
[in]docThe document. Cinema 4D owns the pointed document.
[in]dataThe effector's internal data, filled in. Cinema 4D owns the pointed data.
[in]indexThe current point/particle index.
[in]mdThe MoData. Cinema 4D owns the pointed motion data.
[in]globalposThe global space position of the current point/particle.
[in]fall_weightThe falloff strength for the current point.

◆ CalcPointColor()

virtual Vector CalcPointColor ( const BaseObject op,
const BaseObject gen,
const BaseDocument doc,
const EffectorDataStruct data,
const maxon::GenericData extraData,
const MutableEffectorDataStruct mdata,
Int32  index,
MoData md,
const Vector globalpos,
Float  fall_weight 
) const
virtual

Called in a value driven effector for each point/particle that is needed (where ModifyPoints has not been override).

Note
Only has an effect when the effector is set to change the point/particle's color.
Parameters
[in]opThe effector object. Cinema 4D owns the pointed object.
[in]genThe object that owns the MoData (motion particle generator). Cinema 4D owns the pointed object.
Can sometimes be the same as the effector, mostly used for matrix, internally used to get MoData when no MoData is sent.
[in]docThe document. Cinema 4D owns the pointed document.
[in]dataThe effector's internal data, filled in. Cinema 4D owns the pointed data.
[in]indexThe current point/particle index.
[in]mdThe MoData. Cinema 4D owns the pointed motion data.
[in]globalposThe global space position of the current point/particle.
[in]fall_weightThe falloff strength for the current particle.
Returns
The color for a point.

◆ CalcFields()

Bool CalcFields ( const BaseDocument doc,
const BaseObject generatorObject,
MoData md,
FIELDSAMPLE_FLAG  flags,
FieldOutput result 
) const

Retrieves the FieldResult calculation from an Effector. This if there is no C4DFalloff then this should be used instead.

Parameters
[in]docThe active document.
[in]generatorObjectThe generator object calling the Effector.
[in]mdThe MoData that you want to sample.
[in]flagsThe FEILDSAMPLE_FLAG flags that determine what will be sampled.
Returns
Null if it fails, else a FieldOutput structure pointer (Effector owns the data) containing sampled values for the passed MoData matrices.

◆ GetAccessedObjectsEffectorBase()

static maxon::Result<Bool> GetAccessedObjectsEffectorBase ( const BaseList2D node,
METHOD_ID  method,
AccessedObjectsCallback access,
ACCESSED_OBJECTS_MASK  ensureReadable = ACCESSED_OBJECTS_MASK(0) 
)
static

Member Data Documentation

◆ edata

maxon::BaseRef<EffectorDataParameters, maxon::DeepConstnessPointerHandler> edata

Private. Internal.