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
    • Recent
    • Tags
    • Users
    • Register
    • Login

    Storage of data

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 203 Views
    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 Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 04/01/2005 at 10:24, xxxxxxxx wrote:

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

      ---------
      Hello,
      i have problems storing persistent data (like member variables) in my from ObjectData derived class:

        
      class C4DNode_NodeData: public ObjectData  
      {  
      INSTANCEOF(C4DNode_NodeData,ObjectData)  
      private:  
           String teststring;  
      public:  
           virtual Bool Init(GeListNode *node);  
           virtual Bool GetDDescription(GeListNode *node, Description *description,LONG &flags;);  
           void SetString(String _g);  
      };  
        
      ...  
      //the following functions are in the same order in that they are called  
        
      Bool C4DNode_NodeData::Init(GeListNode *node)  
      {     teststring = "initvalue";  
           return TRUE;  
      }  
        
      void C4DNode_NodeData::SetString(String _g)  
      {     teststring = "newvalue";  
      }  
        
      Bool C4DNode_NodeData::GetDDescription(GeListNode *node, Description *description,LONG &flags;)  
      {     ...  
           GePrint(teststring); //here is teststring "initvalue", not "newvalue"  
           ...  
      }  
        
      

      I tried the same with a BaseContainer, but the function SetString() doesn't change the value. But if i change an existing container of my description in SetString() with ...->SetLong(TESTID, 1) the value is changed in my object. What's wrong? Is there a better way to store member variables?

      Thanks for any help,
      Torsten

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 07/01/2005 at 02:56, xxxxxxxx wrote:

        Problem solved (in an unusual way).
        I change my member variables by sending a message.

          
        ...  
        void C4DNode_NodeData::SetString(String _g)  
        {     String gtemp = "newvalue";  
             ((PluginObject* )this)->Message(UWM_MYOWNMESSAGE, &gtemp;);  
        }  
          
        Bool C4DNode_NodeData::Message(GeListNode *node, LONG type, void *t_data)  
        {       
             if(type == UWM_MYOWNMESSAGE)                 
             {     String* gtemp = (String* )t_data;  
                  g = gtemp->SubStr(0,gtemp->GetLength()); //found no better way to get String from String*   
             }  
             return TRUE;  
        }      
        ...  
        

        Torsten

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