Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    ReadVector() in object's Read()

    SDK Help
    0
    3
    277
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      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)   
          {   
              hf->WriteVector(VecStruct.MyVector[1]);   
              return TRUE;   
          }   
        
      // and in my read I use:   
        
          virtual Bool Read(GeListNode *node, HyperFile *hf, LONG Level)   
          {   
              hf->ReadVector(&VecStruct.MyVector;[1]);   
              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?

      WP.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        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:

        hf->ReadVector(&(VecStruct.MyVector[1]));
        
        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          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.

          WP.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post