Description: Get Icon of Cycle

  • On 12/05/2013 at 16:02, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:    
    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);

    The output is:

    Getting 'Type' items:
        Ball and Socket
        Twist Slider
        Wheel Suspension

    I actually expected it to be

    Getting 'Type' items:
        Ball and Socket&i180000162

    and so forth.

    Thanks in advance!

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


Log in to reply