#include <c4d_nodedata.h>
A data class for creating node plugins.
Use RegisterNodePlugin() to register a node plugin.
Public Member Functions | |
NodeData () | |
GeListNode * | Get (void) const |
virtual Bool | Message (GeListNode *node, Int32 type, void *data) |
virtual void | GetBubbleHelp (GeListNode *node, maxon::String &str) |
virtual BaseDocument * | GetDocument (GeListNode *node) |
virtual Int32 | GetBranchInfo (GeListNode *node, BranchInfo *info, Int32 max, GETBRANCHINFO flags) |
virtual Bool | IsInstanceOf (const GeListNode *node, Int32 type) const |
virtual Bool | IsDocumentRelated (const GeListNode *node, Bool &docrelated) const |
Public Member Functions inherited from BaseData | |
BaseData () | |
virtual | ~BaseData (void) |
void | Destructor (void) |
Protected Attributes | |
GeListNode * | private_link |
Init/Free | |
virtual Bool | Init (GeListNode *node) |
virtual void | Free (GeListNode *node) |
Read/Write/Copy | |
virtual Bool | Read (GeListNode *node, HyperFile *hf, Int32 level) |
virtual Bool | Write (GeListNode *node, HyperFile *hf) |
virtual Bool | CopyTo (NodeData *dest, GeListNode *snode, GeListNode *dnode, COPYFLAGS flags, AliasTrans *trn) |
Description | |
virtual Bool | GetDDescription (GeListNode *node, Description *description, DESCFLAGS_DESC &flags) |
virtual Bool | GetDParameter (GeListNode *node, const DescID &id, GeData &t_data, DESCFLAGS_GET &flags) |
virtual Bool | SetDParameter (GeListNode *node, const DescID &id, const GeData &t_data, DESCFLAGS_SET &flags) |
virtual Bool | GetDEnabling (GeListNode *node, const DescID &id, const GeData &t_data, DESCFLAGS_ENABLE flags, const BaseContainer *itemdesc) |
virtual Bool | TranslateDescID (GeListNode *node, const DescID &id, DescID &res_id, C4DAtom *&res_at) |
NodeData | ( | ) |
Default constructor.
GeListNode* Get | ( | void | ) | const |
Gets the GeListNode connected with the NodeData instance.
|
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 in GvOperatorData, and EffectorData.
|
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 in EffectorData.
|
virtual |
Called when a node is loaded from a file.
Read any member variable for the node data class. Example:
For future extensions of the node data check the level and only read the appropriate values:
[in] | node | The GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node. |
[in] | hf | The hyper file to read from. Cinema 4D owns the pointed hyper file. |
[in] | level | The plugin level is similar to a version number. The default level is 0. Increase this for new revisions of a plugin to allow for forward and backward compatibility. As an example you may have updated a plugin. If you now need to write additional information for new member variables or changed types for old members increase the level. During loading either a 0 is passed (if the file was written by the old plugin) or 1 (if the file was written by the new plugin). This allows to easily write/read new values. For forward and backward compatibility to work any existing read order from a given level must not be changed. Cinema 4D skips any new settings automatically if they have not been read. level is only useful if variables are written/read in NodeData::Write/ NodeData::Read. If all values are stored in the node's container, you do not have to deal with the level. |
|
virtual |
Called when a node is saved to a file.
Write any member variable for the node data class.
Example:
For future extensions of the node data make sure to introduce a new level when writing new values:
[in] | node | The GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node. |
[in] | hf | The hyper file to write to. Cinema 4D owns the pointed hyper file. |
|
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 in EffectorData.
|
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 in EffectorData.
|
virtual |
Called to create a contextual bubble help and status bar information for the node.
[in] | node | The GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node. |
[in] | str | The bubble help string. |
|
virtual |
Called to tell Cinema 4D how to retrieve the document for the node.
Any call to GeListNode::GetDocument() ends up here.
[in] | node | The GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node. |
|
virtual |
Called to specify that the node acts as a container of other nodes.
This is for instance used by the animator module to make sure that the nodes are animated. Simply fill in the passed array:
[in] | node | The GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node. |
[out] | info | An array of max BranchInfo structures to fill in. Cinema 4D owns the pointed array. |
[in] | max | The number of BranchInfo structures in the info array. |
[in] | flags | The get branch info flags: GETBRANCHINFO |
|
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 in EffectorData.
|
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 in GvOperatorData, and EffectorData.
|
virtual |
Called to override the reading of description parameters.
Necessary for parameters that are not simply stored in the node's container, e.g. the global position of an object.
Modify the passed t_data if the right id is provided, and 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::GetDParameter 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. |
[out] | t_data | The parameter data to return. Cinema 4D owns the pointed data. |
[in,out] | flags | The flags for the description operation: DESCFLAGS_GET |
Reimplemented in GvOperatorData.
|
virtual |
Called to override the writing of parameters.
Read the passed t_data if the right id was provided, store the data, and 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::SetDParameter 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 to set. Cinema 4D owns the pointed data. |
[in,out] | flags | The flags for the description operation: DESCFLAGS_SET |
Reimplemented in GvOperatorData.
|
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 in GvOperatorData, and EffectorData.
|
virtual |
Called by the Attribute Manager for every object and every description ID.
Gives a node data the opportunity to route a description ID in the description of a GeListNode to another one.
For example used for tags that are embedded in an object description so that the keyframer for a tag property creates the track on the tag and not on the object.
[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 source description ID. |
[out] | res_id | Assign the target description ID. |
[out] | res_at | Assign the target object. |
|
virtual |
Called by the Attribute Manager for correct undo handling.
[in] | node | The GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node. |
[in] | docrelated | Assign true if the node is part of the document, otherwise false. |
Reimplemented in SculptBrushModifierData.
|
protected |