SOLVED Dynamically changing icons

Is it possible to dynamically change icons of python plugins(object generators, deformers, tags, etc)

Hello,

you can dynamically change the icon of ObjectData and TagData based plugins by implementing NodeData.Message() and reacting to the message MSG_GETCUSTOMICON. There you can define the BaseBitmap used as the icon. Something like this:

if type == c4d.MSG_GETCUSTOMICON:

    # load a standard Cinema icon
    icon = c4d.bitmaps.InitResourceBitmap(c4d.RESOURCEIMAGE_OK)
    data["bmp"] = icon
    data["w"] = icon.GetBw()
    data["h"] = icon.GetBh()
    # set as filled
    data["filled"] = True

    return True

You find related information in the C++ documentation (NodeData::Message() Manual).

best wishes,
Sebastian

Thanks, Sebastian! 🙂

I have another question, but I'm afraid this is not possible.

Can I change/override icons of C4D's built-in objects?
For example, by making objects a child of object generator plugin and change their icons from parent.

Hello,

no, it is not possible to change the icons of other components. Only the component itself can change its icon as show above.

best wishes,
Sebastian

Ok Thanks 💙