#include <c4d_baseeffectordata.h>
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.)
Public Attributes | |
EffectorDataParameters * | edata |
|
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.
[in] | node | The GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node. |
Reimplemented from NodeData.
|
virtual |
Called when a node data instance is deallocated.
Deallocate member variables of the node data class here.
[in] | node | The GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node. |
Reimplemented from NodeData.
|
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.
SUPER
syntax is only available when the INSTANCEOF macro has been invoked for the NodeData which contains the NodeData::GetDDescription implementation.} [in] | node | The GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node. |
[in,out] | description | The node's description to add the parameters to. Cinema 4D owns the pointed description. |
[in,out] | flags | The flags for the description operation: DESCFLAGS_DESC |
Reimplemented from NodeData.
|
virtual |
Called to draw additional information for the object in the editor view.
Be sure to call the parent version as last return:
[in] | op | The BaseObject connected with the ObjectData instance. Equal to static_cast <BaseObject*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed object. |
[in] | drawpass | The draw pass: DRAWPASS |
[in] | bd | The editor's view. The caller owns the pointed view. |
[in] | bh | The helper for the editor's view. The caller owns the pointed view helper. |
Reimplemented from ObjectData.
|
virtual |
Called to get the boundaries of the object.
[in] | op | The BaseObject connected with the ObjectData instance. Equal to static_cast <BaseObject*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed object. |
[out] | mp | Assign the center point of the bounding box. |
[out] | rad | Assign the XYZ bounding box radius. |
Reimplemented from ObjectData.
|
virtual |
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:
Cinema 4D will then call Execute() 2 times.
[in] | op | The BaseObject connected with the ObjectData instance. Equal to static_cast <BaseObject*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed object. |
[in] | list | The priority list to add execution points to. Cinema 4D owns the pointed priority list. |
Reimplemented from ObjectData.
|
virtual |
Called at the point in the priority pipeline specified by AddToExecution, or the lack thereof.
[in] | op | The BaseObject connected with the ObjectData instance. Equal to static_cast <BaseObject*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed object. |
[in] | doc | The host document of the object. Cinema 4D owns the pointed document. |
[in] | bt | The calling thread. Can be nullptr. Cinema 4D owns the pointed thread. |
[in] | priority | The priority of the call to Execute() in the pipeline: EXECUTIONPRIORITY |
[in] | flags | The execution flags: EXECUTIONFLAGS |
Reimplemented from ObjectData.
|
virtual |
Called to modify the passed object.
[in] | mod | The BaseObject connected with the ObjectData instance. Equal to static_cast <BaseObject*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed object. |
[in] | doc | The document containing the object to modify. Cinema 4D owns the pointed document. |
[in,out] | op | The object to modify. Cinema 4D owns the pointed object. |
[in] | op_mg | The object's world matrix. |
[in] | mod_mg | The modifier object's world matrix. |
[in] | lod | The level of detail. |
[in] | flags | Currently unused. |
[in] | thread | The calling thread. Can be nullptr. Cinema 4D owns the pointed thread. |
Reimplemented from ObjectData.
|
virtual |
Called when a node receives messages.
[in] | node | The GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node. |
[in] | type | The message type: MSG |
[in,out] | data | The message data. The sender owns the pointed data. |
Reimplemented from NodeData.
|
virtual |
Called to get the number of handles the object has.
Part of the automated handle interface.
[in] | op | The BaseObject connected with the ObjectData instance. Equal to static_cast <BaseObject*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed object. |
Reimplemented from ObjectData.
|
virtual |
Called to get the information for handle i.
Part of the automated handle interface.
[in] | op | The BaseObject connected with the ObjectData instance. Equal to static_cast <BaseObject*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed object. |
[in] | i | The handle index. |
[in,out] | info | Fill with the handle information. |
Reimplemented from ObjectData.
|
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.
[in] | op | The BaseObject connected with the ObjectData instance. Equal to static_cast <BaseObject*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed object. |
[in] | i | The handle index. |
[in] | p | The handle's position. |
[in] | info | The handle information. |
Reimplemented from ObjectData.
|
virtual |
Called when a node is duplicated.
Copy any member variable for the node plugin. Simply transfer from this to dest and/or snode to dnode:
[out] | dest | The destination node data. Cinema 4D owns the pointed node. |
[in] | snode | The source node. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node. |
[out] | dnode | The destination node. Cinema 4D owns the pointed node. |
[in] | flags | The copy flags: COPYFLAGS |
[in] | trn | An alias translator for the operation. Can be nullptr. The sender owns the pointed alias translator. |
Reimplemented from NodeData.
|
virtual |
Called to check if the node is an instance of a base type.
[in] | node | The GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node. |
[in] | type | The type to check. |
Reimplemented from NodeData.
|
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.
SUPER
syntax is only available when the INSTANCEOF macro has been invoked for the NodeData which contains the NodeData::GetDEnabling implementation.} [in] | node | The GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node. |
[in] | id | The ID of the parameter. |
[in] | t_data | The parameter data. Cinema 4D owns the pointed data. |
[in] | flags | Not used. |
[in] | itemdesc | The parameter's description, encoded to a container as described in Description. |
Reimplemented from NodeData.
|
virtual |
Called to initialize the effector. Replacement NodeData::Init function for effectors.
Called when effector is first created.
[in] | node | Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node. |
|
virtual |
Called to free the effector. Replacement NodeData::Free function for effectors.
Called when effector is deleted.
[in] | node | Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node. |
EffectorDataStruct* GetEffectorData | ( | ) |
Gets the effector's internal data.
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.
void AddEffectorDependence | ( | BaseObject * | op | ) |
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.)
[in] | op | The object to add a dependency on. The caller owns the pointed object. |
|
virtual |
Called to get the effector flags.
|
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.
[in] | node | Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node. |
[in,out] | description | The description to modify. Cinema 4D owns the pointed description. |
[in] | ar | The atom array to pass along. Cinema 4D owns the pointed atom array. |
|
virtual |
Called to execute the effector.
Called first of all in the effector execution pipeline. Fill the EffectorDataStruct and call InitPoints().
[in] | op | The effector object. Cinema 4D owns the pointed object. |
[in] | doc | The document. Cinema 4D owns the pointed document. |
[in] | gen | The 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] | md | The motion data sent to the effector, may be nullptr. Cinema 4D owns the pointed motion data. |
[in] | strength | The strength value. |
[in] | thread | The thread the effector is being executed in. Cinema 4D owns the pointed thread. |
|
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.
[in] | op | The effector object. Cinema 4D owns the pointed object. |
[in] | gen | The 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] | doc | The document. Cinema 4D owns the pointed document. |
[in] | data | The effector's internal data, filled in. Cinema 4D owns the pointed data. |
[in] | md | The MoData the effector will modify. Cinema 4D owns the pointed motion data. |
[in] | thread | The thread the effector is being executed in. Cinema 4D owns the pointed thread. |
|
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.
[in] | op | The effector object. Cinema 4D owns the pointed object. |
[in] | gen | The 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] | doc | The document. Cinema 4D owns the pointed document. |
[in] | data | The effector's internal data, filled in. Cinema 4D owns the pointed data. |
[in] | md | The MoData the effector will modify. Cinema 4D owns the pointed motion data. |
[in] | thread | The thread the effector is being executed in. Cinema 4D owns the pointed thread. |
|
virtual |
Called to free the points/particles.
Called after the particles have been modified; clear any data at this point.
|
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).
[in] | op | The effector object. Cinema 4D owns the pointed object. |
[in] | gen | The 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] | doc | The document. Cinema 4D owns the pointed document. |
[in] | data | The effector's internal data, filled in. Cinema 4D owns the pointed data. |
[in] | index | The current point/particle index. |
[in] | md | The MoData. Cinema 4D owns the pointed motion data. |
[in] | globalpos | The global space position of the current point/particle. |
[in] | fall_weight | The falloff strength for the current particle. |
|
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.
[in] | op | The effector object. Cinema 4D owns the pointed object. |
[in] | gen | The 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] | doc | The document. Cinema 4D owns the pointed document. |
[in] | data | The effector's internal data, filled in. Cinema 4D owns the pointed data. |
[in] | index | The current point/particle index. |
[in] | md | The MoData. Cinema 4D owns the pointed motion data. |
[in] | globalpos | The global space position of the current point/particle. |
[in] | fall_weight | The falloff strength for the current point. |
|
virtual |
Called in a value driven effector for each point/particle that is needed (where ModifyPoints has not been override).
[in] | op | The effector object. Cinema 4D owns the pointed object. |
[in] | gen | The 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] | doc | The document. Cinema 4D owns the pointed document. |
[in] | data | The effector's internal data, filled in. Cinema 4D owns the pointed data. |
[in] | index | The current point/particle index. |
[in] | md | The MoData. Cinema 4D owns the pointed motion data. |
[in] | globalpos | The global space position of the current point/particle. |
[in] | fall_weight | The falloff strength for the current particle. |
FieldOutput* CalcFields | ( | BaseDocument * | doc, |
BaseObject * | generatorObject, | ||
MoData * | md, | ||
FIELDSAMPLE_FLAG | flags | ||
) |
Retrieves the FieldResult calculation from an Effector. This if there is no C4DFalloff then this should be used instead.
[in] | doc | The active document. |
[in] | generatorObject | The generator object calling the Effector. |
[in] | md | The MoData that you want to sample. |
[in] | flags | The FEILDSAMPLE_FLAG flags that determine what will be sampled. |
EffectorDataParameters* edata |
Private. Internal.