#include <c4d_customdatatype.h>
A data class for creating custom data types.
These can be used in descriptions and container just like built-in data types. Use RegisterCustomDataTypePlugin() to register a custom data type plugin.
Private Attributes | |
Int32 | defaultconversiontype |
GV_VALUE_HANDLER * | valuehandler |
Default constructor.
|
pure virtual |
Called to get the plugin ID of the custom data type.
|
virtual |
Called to get the plugin ID used for the custom data type.
|
virtual |
Called to get the plugin ID used for Graph View values.
|
pure virtual |
Called to allocate an instance of the internal data type class and return it.
|
pure virtual |
Called to free an instance of the custom data type.
[in,out] | data | The custom data type instance to free. |
|
pure virtual |
Called to copy an instance of the custom data type. Copy the data from src to dest.
[in] | src | The source custom data type. |
[out] | dest | The destination custom data type. |
[in] | aliastrans | An alias translator for the operation. Can be nullptr. The caller owns the pointed alias translator. |
|
pure virtual |
Called to compare a pair of custom data types.
[in] | d1 | The first data. |
[in] | d2 | The second data. |
|
pure virtual |
Called to write the custom data type to a file.
[in] | d | The custom data type instance to write. Cinema 4D owns the pointed data. |
[in] | hf | The hyper file to write the custom data type to. Cinema 4D owns the pointed hyper file. |
|
pure virtual |
Called to read the custom data type from a file.
[in,out] | d | The custom data type instance to read. Cinema 4D owns the pointed data. |
[in] | hf | The hyper file to read the custom data type 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 settings or changed types for old settings 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. |
|
pure virtual |
Called to get the symbol to use in resource files, for example "GRADIENT".
const Char*
string with the resource symbol.
|
virtual |
Called to get the properties that the custom data type accepts in resource files.
|
virtual |
Called to provide default properties for the custom data type.
These properties will be used if the user does not specify anything else.
It is common to add DESC_ANIMATE and DESC_CUSTOMGUI to the default properties:
[in] | data | The container to fill with the default properties. |
Called to retrieve a pointer to a global array representing the data types that the custom data type can be converted from.
[out] | table | Set this to point to the custom data type conversion from table. |
|
virtual |
Converts the Graph View data given by src_type and src[cpu_id] to the custom data type in dst.
[in] | src_type | The source type. One of the IDs given by GetConversionsFrom(). |
[in] | src | The source data array. Depends on src_type. Cinema 4D owns the pointed array. |
[in] | cpu_id | The CPU index, i.e. the position in the src array. |
[out] | dst | The destination custom data type. Points to an instance of the internal data type. Write the converted data to this object. Cinema 4D owns the pointed data. |
Called to retrieve a pointer to a global array representing the data types that the custom data type can be converted to.
Here is an example:
[out] | table | Set this to point to the custom data type conversion to table. |
|
virtual |
Called to convert the custom data type in src to the Graph View data given by dst_type and dst[cpu_id].
[in] | dst_type | The destination type. One of the IDs given by GetConversionsTo(). |
[in] | src | The source custom data type. Points to an instance of the internal data type. Cinema 4D owns the pointed data. |
[out] | dst | The destination data array. Depends on dst_type. Write the converted data to this object. Cinema 4D owns the pointed array. |
[in] | cpu_id | The CPU index, i.e. the position in the dst array. |
|
virtual |
Called to convert the custom data type in src to GeData dst.
[in] | dst_type | The destination type. One of the IDs given by GetConversionsTo(). |
[in] | src | The source custom data type. Points to an instance of the internal data type. Cinema 4D owns the pointed data. |
[out] | dst | The destination data. Depends on dst_type. Write the converted data to this object. Cinema 4D owns the pointed data. |
|
virtual |
Called to retrieve the valid calculations for the custom data type.
|
virtual |
Called to carry out a calculation.
[in] | calculation | The calculation: GvValueFlags |
[in] | src1 | The first source custom data type. Depends on calculation. Cinema 4D owns the pointed data. |
[in] | src2 | The second source custom data type. Depends on calculation. Cinema 4D owns the pointed data. |
[out] | dst | The destination custom data type. Depends on calculation. Cinema 4D owns the pointed data. |
[in] | parm1 | A Float parameter. Depends on calculation. |
|
virtual |
Called to retrieve the internal GV_VALUE_HANDLER struct for the custom data type.
Called to convert the data in src to the Graph View data given by dst[cpu_id].
[in] | src | The source data. Cinema 4D owns the pointed data. |
[out] | dst | The destination data array. Cinema 4D owns the pointed array. |
[in] | cpu_id | The CPU index, i.e. the position in the dst array. |
Called to convert the internal data in src as an array referenced by cpu_id to a GeData in dst.
[in] | src | The source data array. Cinema 4D owns the pointed array. |
[in] | cpu_id | The CPU index, i.e. the position in the src array. |
[out] | dst | The destination data. Cinema 4D owns the pointed data. |
|
virtual |
Dummy virtual method to get the virtual warning.
|
virtual |
Called to add sub-parameters to the description for the custom data type.
Modify the passed description res object as needed, set the appropriate flags and then make sure to include a call to the parent at the end:
[in] | data | The custom data type to get the description for. Points to an instance of the internal data type. Cinema 4D owns the pointed data. |
[out] | res | The description to add the parameters to. |
[in,out] | flags | The flags for the description operation: DESCFLAGS_DESC |
[in] | parentdescription | The description container for the parent's description, encoded as described in Description. |
[out] | singledescid | Private. |
|
virtual |
Called to override the reading of parameters.
Modify the passed t_data if the right id was provided, and set the appropriate flags. Then make sure to include a call to the parent at the end:
[in] | data | The custom data type to get the parameters for. Points to an instance of the internal data type. Cinema 4D owns the pointed data. |
[in] | id | The ID of the parameter. |
[out] | t_data | The current data for the parameter. |
[in,out] | flags | The flags for the description operation: DESCFLAGS_DESC |
|
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. Then make sure to include a call to the parent at the end:
[in] | data | The data to set the parameter for. Points to an instance of the internal data type. Cinema 4D owns the pointed data. |
[in] | id | The ID of the parameter. |
[out] | t_data | The data to write. |
[in,out] | flags | The flags for the description operation: DESCFLAGS_DESC |
|
virtual |
Called to decide which parameters should be enabled or disabled.
Read the passed t_data if the right id was provided, and return true to enable the parameter or false to disable it depending on the value. Then make sure to include a call to the parent at the end:
[in] | data | The data to enable or disable. Points to an instance of the internal data type. Cinema 4D owns the pointed data. |
[in] | id | The ID of the parameter. |
[in] | t_data | The current data for the parameter. |
[in] | flags | Not used. |
[in] | itemdesc | The description, encoded to a container as described in Description. |
|
virtual |
Override this method to animate the custom data type.
Set res to t_data1*mix + t_data2*(1-mix) in a way that makes sense for the custom data type.
[in] | res | The animated value. |
[in] | t_data1 | The first value. |
[in] | t_data2 | The second value. |
[in] | mix | The mixing factor. |
[in] | flags | Not used. |
|
virtual |
Called to let validate the values of data with the settings in bc.
Modify data accordingly so that it is valid.
[in] | bc | The settings container. |
[in,out] | data | The data value to check. |
|
private |
|
private |