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
    • Recent
    • Tags
    • Users
    • Login

    Toggle Button

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 329 Views
    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 Offline
      Helper
      last edited by

      On 05/12/2013 at 21:10, xxxxxxxx wrote:

      I have a command Data PlugIn with an Icon assigned within the RegisterCommandPlugin.
      This PlugIn works as a toggle for a message Data PlugIn. Now I want the icon to be switched to a new one, when I press the PlugIn Button. Found some information on how to toggle Menu Buttons but no idea for the the plugin icon...

      Btw, is it a save and proper way to store settings of a plugin (in this case the toggle state) within the Document Container with the PluginID? So it gets loaded with the scene file...

      doc.GetDataInstance().SetData(PLUGIN_ID, 1)

      For more settings to be saved, I would create a new SubContainer at the Plugin Id?

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

        On 06/12/2013 at 04:46, xxxxxxxx wrote:

        1. get the plugins BaseList2D icon and modify / overwrite it. use the search function, it has been discussed recently quite extensively.
        2. yes, you can/should store data in that way in the document.

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

          On 06/12/2013 at 18:44, xxxxxxxx wrote:

          Thanks, I guess you are reffering to this post?
          https://developers.maxon.net/forum/topic/7462/9284_change-icon-based-on-state-in-commanddata&KW=icon&PID=36793#36793
          Just for the understanding, you don´t actully load a new icon, you manipulating the real bitmap data in memory with the data of another one?

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

            On 06/12/2013 at 22:30, xxxxxxxx wrote:

            Both times yes. If you want to 'load' a new icon you have to overwrite
            the existing pixel by pixel. Do not forget to also modify the alpha channel
            properly.

            Happy rendering,
            Ferdinand

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