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

    [SOLVED] ARROWBUTTON resource not accessible for Python?

    Cinema 4D SDK
    2
    5
    664
    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.
    • mocolocoM
      mocoloco
      last edited by mocoloco

      Hi there,

      I was going through the resource documentation (C++) and I discovered that there is a button resource called ARROWBUTTON (here the link).

      I tried to used it on a .res for a TAG plugin written in Python, but I only get errors as soon as I'm writing ARROWBUTTON, either using it or using CUSTOMGUI parameter.

      CONTAINER myTAGPLUGIN
      {
      	NAME myTAGPLUGIN;
      
      	GROUP {
      		BUTTON BT_LEFT { CUSTOMGUI ARROWBUTTON; ARROW_LEFT; }
      	}
      }
      
      CONTAINER myTAGPLUGIN
      {
      	NAME myTAGPLUGIN;
      
      	GROUP {
      		ARROWBUTTON BT_LEFT { ARROW_LEFT; }
      	}
      }
      

      Is there a way to get this to create a simple arrow button in a TAG plugin in Python, or this is a part of the SDK limitations?

      Thanks,

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @mocoloco
        last edited by

        Hello @mocoloco,

        Thank you for reaching out to us. The gadget ARROWBUTTON is a dialog resource element. A TagData plugin is an instance of a NodeData plugin, implementing a description ressource. The two are not interchangable and you cannot place an ARROWBUTTON gadget in a description resource directly. The only way to do so, is to implement an iCustomGui where you can place the ARROWBUTTON, to later then use that custom GUI of yours in description resource of your node. Implementing custom GUIs is only possible with our C++ API.

        You can also place a BITMAPBUTTON inside a description resource, but you are much more limited when it comes to the layout of the buttons compared to the same gadget in a dialog.

        Markup:

        // The description defintion of the tag Tmmover.
        CONTAINER Tmmover
        {
          NAME Tmmover;
          INCLUDE Texpression;
        
          // The main "Tag" tab of the tag.
          GROUP ID_TAGPROPERTIES
          {
            // ...
            GROUP 
            {
              COLUMNS 2;
              BITMAPBUTTON ID_BTN_BCK { ICONID1 12411; }
              BITMAPBUTTON ID_BTN_FWD { ICONID1 12412; }
            }
          }
        }
        

        Result:
        Screenshot 2023-01-09 at 13.46.47.png

        To learn more about resources, I would recommend these manuals.

        • Resource Files Manual
          • Description Resource
          • Dialog Resource

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • mocolocoM
          mocoloco
          last edited by

          Thanks a lot @ferdinand, I'm going to have a look on BITMAPBUTTON and see if that can make the trick or not 😉

          Cheers,
          Christophe

          1 Reply Last reply Reply Quote 0
          • mocolocoM
            mocoloco
            last edited by

            It does the trick, thanks a lot @ferdinand !
            Cheers,
            Christophe

            1 Reply Last reply Reply Quote 0
            • ferdinandF
              ferdinand
              last edited by ferdinand

              Great to hear! One thing I forgot to mention:

              • For ICONID1 XXX and ICONID2 YYY you can use any of the built-in icon IDs as listed here.
              • When you want to use your own icons, you must make sure the icon IDs are registered before the node which is using them in its description. Simply put the c4d.gui.RegisterIcon call before the RegisterXXXPlugin call of the plugin using them.

              Cheers,
              Ferdinand

              MAXON SDK Specialist
              developers.maxon.net

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