Read User Data



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

    On 27/05/2010 at 04:47, xxxxxxxx wrote:

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

    ---------
    Hello,

    I try to read the user data from base objects with the BrowseGetNext(..) function.
    I get back the DescID and a basecontainer with the data.
    But now i don't know how i can access to this data. Which IDs should i using?
    I get only the name of the "User Data" with following function.

    ...
    while ( pUserData->BrowseGetNext(handle, &id, &data) )
    {
      uid = id[1].id;
      uType = id[1].dtype;
      GeData att_name;

    att_name = data->GetData(1);
    }

    But i need also the value of it and some furter informations like min and max values or so.
    Has anyone an idea?



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

    On 28/05/2010 at 01:44, xxxxxxxx wrote:

    ok, now i get the additional attibutes like min and max value with the BrowseContainer class.
    But i don't get the value of the user data. Only the information, that a DA_CUSTOMDATATYPE is delivered.

    BrowseContainer brw(data);
                  LONG lid = 0;
                  GeData *att = NULL;

    while (brw.GetNext(&lid, &att)) {...

    How can i read the data value ???



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

    On 28/05/2010 at 02:12, xxxxxxxx wrote:

    What kind of user data type do you want to access?

    cheers,
    Matthias



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

    On 28/05/2010 at 02:17, xxxxxxxx wrote:

    hi,

    every type. I add the User data in the attribute manager and choosen one type from the list. (Boolean, Integer, Real...). And with a plugin i like to export this data into an external file.

    regards
    Markus



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

    On 28/05/2010 at 02:18, xxxxxxxx wrote:

    Maybe you can show me an example for a LONG value ?



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

    On 28/05/2010 at 03:30, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    every type...

    Ah, ok. That's actually quite simple.

    Here is an example how to determine the data type and value of the user data entries:

      
    Bool MenuTest::Execute(BaseDocument *doc)  
    {  
      BaseObject *op = doc->GetActiveObject();  
      if (!op) return FALSE;  
      
      DynamicDescription *dd = op->GetDynamicDescription();  
      if (!dd) return FALSE;  
      
      void *dhandle = dd->BrowseInit();  
      
      DescID id;  
      const BaseContainer *bc = NULL;  
      
      while (dd->BrowseGetNext(dhandle, &id, &bc))  
      {  
          GeData data;  
      
          if (op->GetParameter(id, data, 0))  
          {  
              //data contains the user data data; the data type of the user data  
              switch (data.GetType())  
              {  
                  case DA_REAL:  
                      GePrint("Real: "+RealToString(data.GetReal()));  
                      break;  
                  case DA_LONG:  
                      GePrint("LONG: "+LongToString(data.GetLong()));  
                      break;  
              }  
          }  
      }  
      
      dd->BrowseFree(dhandle);  
      
      return TRUE;  
    }  
    

    cheers,
    Matthias



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

    On 28/05/2010 at 04:07, xxxxxxxx wrote:

    oh i see,

    thanks a lot... it works


Log in to reply