[SOLVED] ARROWBUTTON resource not accessible for Python?

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,

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.

Cheers,
Ferdinand

MAXON SDK Specialist
developers.maxon.net

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

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

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