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

    Description: Get Icon of Cycle

    SDK Help
    0
    3
    360
    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 12/05/2013 at 16:02, xxxxxxxx wrote:

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

      ---------
      I'm trying to display the menu items in the description of the Connector Object in my dialog. I can
      successfully extract the names of the items, but the icons are not included. In a dialog, they are
      added by appending an &iXXX to the name of the element where XXX is the ID of the icon. But they
      are not included in the cycle container. Where are they stored?

                 do {
                      BaseObject* op = BaseObject::Alloc(pluginid);
                      if (!op) break;
                      AutoFree<BaseObject> free(op);
        
                      AutoAlloc<Description> desc;
                      if (!op->GetDescription(desc, DESCFLAGS_DESC_0)) break;
        
                      BaseContainer temp;
                      AutoAlloc<AtomArray> arr;
                      const BaseContainer* param = desc->GetParameter(FORCE_TYPE, temp, arr);
                      if (!param) break;
        
                      const BaseContainer* cycle = param->GetContainerInstance(DESC_CYCLE);
                      if (!cycle) break;
        
                      GePrint("Getting 'Type' items:");
        
                      LONG i = 0;
                      LONG last_id = -1;
                      while (true) {
                          LONG id = cycle->GetIndexId(i++);
                          if (id == NOTOK) break;
        
                          String name = cycle->GetString(id);
                          if (name.Content()) {
                              if (last_id < 0) last_id = id;
                              GePrint("    " + name);
                              AddChild(CMB_TYPE, id, name);
                          }
                      }
        
                      SetLong(CMB_TYPE, last_id);
                  } while (0);
        
                  LayoutChanged(CMB_TYPE);
      

      The output is:

      Getting 'Type' items:
          Hinge
          Cardan
          Ball and Socket
          Ragdoll
          Slider
          Twist Slider
          Planar
          Box
          Wheel Suspension
          Fixed
      

      I actually expected it to be

      Getting 'Type' items:
          Hinge&i180000011
          Cardan&i180000161
          Ball and Socket&i180000162
          ...
      

      and so forth.

      Thanks in advance!
      -Niklas

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

        On 12/05/2013 at 16:24, xxxxxxxx wrote:

        the & notation is just a packed value format for the resource syntax. search for desc_items
        in the cpp sdk, it is a list of the various ids attached to a description element the cycle
        symbols seem to be stored in a separate container.

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

          On 12/05/2013 at 16:59, xxxxxxxx wrote:

          Thanks Ferdinand, the DESC_ITEMS tip was great! I haven't seen the DESC_CYCLEICONS item so far
          which is the solution to the problem.

          Best,
          -Niklas

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