ReadVector() in object's Read()

On 30/05/2013 at 05:36, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R14 
Platform:   Windows  ;   
Language(s) :     C++  ;

Hi Folks,

in my object plugin I'm now going through the motions of trying to save some of the variables etc used in the object's class. I use the Write() function to do the following:

//Just Fyi: there's a struct outside the class with a Vector in it, hence the VecStruct.MyVector[].   
    virtual Bool Write(GeListNode *node, HyperFile *hf)   
        return TRUE;   
// and in my read I use:   
    virtual Bool Read(GeListNode *node, HyperFile *hf, LONG Level)   
        return TRUE;   

But when I try to compile the above it gives me the following compile error:

"error C2664: 'HyperFile::ReadVector' : cannot convert parameter 1 from 'double *' to 'Vector *'"

Why am I unable to use the ReadVector() when using the WriteVector() to save it initially?


On 30/05/2013 at 07:29, xxxxxxxx wrote:

What is MyVector?  If it is a Real[3] then you are doing it incorrectly.  Make it a literal Vector member of the class. Or, at the least, enclose VecStruct.MyVector[1] in parentheses:


On 30/05/2013 at 17:39, xxxxxxxx wrote:

Eh. You're right. I should have looked at my Struct a little closer. I thought it was a Vector but it isn't, it's a vector of Reals.

Thanks Rob.