Description: Get Icon of Cycle



  • 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



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



  • 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


Log in to reply