Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Dynamically changing icons

    Cinema 4D SDK
    python
    2
    5
    1.4k
    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.
    • merkvilsonM
      merkvilson
      last edited by

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

      1 Reply Last reply Reply Quote 0
      • S
        s_bach
        last edited by

        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

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 4
        • merkvilsonM
          merkvilson
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • S
            s_bach
            last edited by

            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

            MAXON SDK Specialist

            Development Blog, MAXON Registered Developer

            1 Reply Last reply Reply Quote 2
            • merkvilsonM
              merkvilson
              last edited by

              Ok Thanks 💙

              1 Reply Last reply Reply Quote 0
              • H HerrMay referenced this topic on
              • First post
                Last post