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

    Custom GUI button via resource description

    Cinema 4D SDK
    c++ r20 r21
    2
    3
    564
    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.
    • C4DSC
      C4DS
      last edited by

      Hi,

      In the past I have been able to programmatically provide a custom gui "clearselection" button in a GeDialog using:

      Bool MyGeDialog::CreateLayout(void)
      {
      	...
      	BaseContainer bc = GetCustomDataTypeDefault(CUSTOMGUI_BITMAPBUTTON);
      	bc = GetCustomDataTypeDefault(CUSTOMGUI_BITMAPBUTTON);
      	bc.SetBool(BITMAPBUTTON_BUTTON, TRUE);
      	bc.SetInt32(BITMAPBUTTON_ICONID1, RESOURCEIMAGE_CLEARSELECTION);
      	AddCustomGui(IDC_FILTER_CLEAR, CUSTOMGUI_BITMAPBUTTON, String(), 0, 0, 0, bc);
      

      I have also been able to provide my own customgui in a DescriptionToolData resource using:

      CONTAINER MyDescriptionTool_desc
      {     
      	NAME MyDescriptionTool_desc;
      
      	GROUP
      	{
      		LONG REFERENCEPOINT_GADGETID { ANIM OFF; CUSTOMGUI REFERENCEPOINT; REFERENCEPOINTS 5; }
      		...
      

      Where "reference point" is a custom gadget allowing to select one of the corners of a rectangle, to be used as reference/origin.

      Now I would like to provide a "clearselection" button as part of a DescriptionToolData resource description.
      Could anyone please point me to an example how to go about this. Thank you.

      1 Reply Last reply Reply Quote 0
      • P
        PluginStudent
        last edited by

        I don't think you can configure a bitmap button in a res file.

        You can add a BITMAPBUTTON parameter in the res file (e.g. ocamera.res). But then you have to implement DescriptionToolData::GetDDescription() to define the specific settings of this parameter's GUI.

        C4DSC 1 Reply Last reply Reply Quote 2
        • C4DSC
          C4DS @PluginStudent
          last edited by

          @PluginStudent

          You mentioning the BITMAPBUTTON and with the help of ExampleSculptGrabBrush::GetDDescription from the cinemasdk I was able to make it work.
          Thanks.

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