Hey @aghiad322,
as I said, classic API CustomDataType types (e.g., the "dots" example) realize their serialization via CustomDatatypeClass::Read and ::Write. The DotsDataClass example implements both methods to read and write the dots data. If you want things to be stored, e.g., your gradient, you will have to implement it there. E.g., it could look like this:
Bool MyDataTypeClass::WriteData(const CustomDataType* t_d, HyperFile* hf) { // Cast the passed in data to your datatype. const MyDataType* const data = static_cast<const MyDataType*>(t_d); // Bail when #data is malformed, has no gradient. _gradient is a member of MyDataType and supposed // to be of type Gradient* just as in your case. if (!data || !data->_gradient) return false; // Wrap the dereferenced _gradient as a GeData instance. GeData geData; geData.SetCustomDataType(*data->_gradient); // Write your data into the hyper file and bail if it somehow fails. if (!hf->WriteGeData(geData)) return false; // Write other data members of your datatype. if (!hf->WriteInt32(data->_someInt32)) return false; if (!hf->WriteFloat(data->_someFloat)) return false; if (!hf->WriteBool(data->_someBool)) return false; return true; }Cheers,
Ferdinand