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

    How do I change the icon of the command plugin

    SDK Help
    0
    3
    329
    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 09/11/2013 at 20:24, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R15 
      Platform:   Windows  ;   Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Because want to switch to two icons icon command plugin
      I was going to change in the GetIcon Sign up for RegisterIcon first, but it can not be renamed.
      Can I change what I do?

      Filename   fn= GeGetPluginPath()+Filename("res")+Filename("Icon.tif");
      AutoAlloc<BaseBitmap> bmp;
      if (IMAGERESULT_OK != bmp->Init(fn)) return false;
      RegisterIcon(ID_IconA, bmp, 0 * 32, 0, 32, 32, ICONFLAG_COPY);
      RegisterIcon(ID_IconB, bmp, 1 * 32, 0, 32, 32, ICONFLAG_COPY);

      Bool Message(Int32 type, void* data)
      {
          switch(type)
          {
           case MSG_GETCUSTOMICON:
              {
                  GetCustomIconData *icon =((GetCustomIconData* )data);
                  if(flag) GetIcon(ID_IconA,icon->dat);
                  else GetIcon(ID_IconB,icon->dat);   
                  icon->filled=TRUE;
              }
              break;
          }
          return true;
      }

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

        On 10/11/2013 at 03:08, xxxxxxxx wrote:

        Hi anoano,

        here's a Python version of how you can change the icon for a CommandData plugin. The
        MSG_GETCUSTOMICON message is for NodeData plugins only.

        https://developers.maxon.net/forum/topic/7462/9284_change-icon-based-on-state-in-commanddata&PID=36785#36785

        Best,
        -Niklas

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

          On 11/11/2013 at 08:39, xxxxxxxx wrote:

          Thanks for Nik.

          Has not been able to resolve to me yet, but I will do my best to refer to it.

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