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
    • Login

    Get name of object properties

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 526 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 13/07/2010 at 02:28, xxxxxxxx wrote:

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

      ---------
      Hello,

      i implemented an objectData plugin with some properties.
      Now i like to read this properties with an further plugin. I get the values and the type of every property, but not the name of it.

      A cutout of the res file:

      CONTAINER OWidget
      {
        INCLUDE Obase;

      GROUP ID_OBJECTPROPERTIES
        {
             DEFAULT 1;

      GROUP {
                 LONG POSX { }
                 LONG POSY { }
                 LONG WIDTH { MIN 0;}
                 LONG HEIGHT { MIN 0;}
                 BOOL VISIBLE { }
                 BOOL PARENTVISIBLE { }
                 BOOL FOCUSED { }

      and the corresponding string table

      STRINGTABLE OWidget
      {
         OWidget              "Widget";

      POSX                 "PosX";
         POSY                 "PosY";
         WIDTH                "Width";
         HEIGHT               "Height";
         VISIBLE              "Visible";
         PARENTVISIBLE        "ParentVisible";
         FOCUSED              "Focused";
      ...

      How can i read this strings to the according values?
      I don't like to add this strings fixed, because they will changed in the future.

      regards
      Markus

      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 13/07/2010 at 03:49, xxxxxxxx wrote:

        You have to use the Description class and access it's container.

        Here is an example which prints the names and ID names of all description elements of an selected object.

          
        Bool MenuTest::Execute(BaseDocument *doc)  
        {  
          BaseObject *op = doc->GetActiveObject();  
          if (!op) return FALSE;  
          
          AutoAlloc<Description> desc;  
          if (!desc) return FALSE;  
          
          if (!op->GetDescription(desc,0)) return FALSE;  
          
          const BaseContainer *bc = NULL;  
          DescID id, groupid;  
          
          void *handle = desc->BrowseInit();  
          if (!handle) return FALSE;  
          
          while (desc->GetNext(handle, &bc, id, groupid))  
          {  
              if (bc)  
              {  
                  GePrint(bc->GetString(DESC_NAME));    //the description element's name  
                  GePrint(bc->GetString(DESC_IDENT));    //the description element's ID name  
              }  
          }  
          
          desc->BrowseFree(handle);  
          
          return TRUE;  
        }  
        

        cheers,
        Matthias

        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 13/07/2010 at 06:43, xxxxxxxx wrote:

          thanks, it works.

          I check also the type of every paramter with DESC_CUSTOMGUI, but i didn't get every type.
          For LONG and BOOL values i got only DA_LONG as type. How can i get the right type?

          best regards
          Markus

          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 13/07/2010 at 06:55, xxxxxxxx wrote:

            Originally posted by xxxxxxxx

            For LONG and BOOL values i got only DA_LONG as type. How can i get the right type?

            It's currently not possible.

            cheers,
            Matthias

            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 13/07/2010 at 23:00, xxxxxxxx wrote:

              Hi,

              i have a further question about a DESC_CUSTOMGUI. I create an CYCLE { } element in the .res file:
              e.g.
                           LONG XALIGNMENT
                           {
                                CYCLE {
                                        nXAlign_Left;
                                        nXAlign_Center;
                                        nXAlign_Right;
                                      }
                           }

              If i read the DESC_CUSTOMGUI back, i get only the DTYPE_LONG value. But i need also the information if this parameter a CYCLE gui, because in this case i must convert the long value to a string value.

              Do you have an idea where i get this information?
              regards
              markus

              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 14/07/2010 at 03:41, xxxxxxxx wrote:

                Just checked some stuff again and you can in fact determine if an element is Bool or LONG. To read the type you should directly access the DescID and check for its DTYPE.

                here is an example:

                  
                while (desc->GetNext(handle, &bc, id, groupid))  
                {  
                  if (bc)  
                  {  
                      LONG type = id[0].dtype;  
                        
                      switch (type)  
                      {  
                          case DTYPE_LONG:  
                              //do something  
                              break;  
                          case DTYPE_BOOL:  
                              //do something  
                              break;  
                      }  
                  }  
                }  
                

                Check its DESC_CUSTOMGUI only for its interface.

                As for failing to check the CYCLE GUI, it seems like a bug to me. I reported it to the developers.

                cheers,
                Matthias

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