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

    Separator in plugins menu

    Cinema 4D SDK
    c++ r19 r20
    3
    3
    654
    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

      While searching through the forum I stumbled upon this post in the legacy forum:
      https://developers.maxon.net/forum/topic/1482/821_menu-separator

      Seeing it's quite old I wonder if this is still the way to go to add separator(s) between plugin entries.
      Assume I have a single plugin file which registers multiple CommandData plugins, where I want a separator between some of them in the plugins menu.

      In the past I had used GetSubContainer to make "groups", but this has its drawbacks, so I would want to have a single list, with separators.

      According to the documentation related to RegisterCommandPlugin I found:

      To affect the order that plugins are displayed in menus add "#$n" as a prefix to this name, where n is a number.
      Lower numbers are displayed before higher numbers. If name is "--" it will show up as a menu separator. 
      

      But this would mean (as mentioned in the legacy forum post) one needs dummy plugin IDs.

      1 Reply Last reply Reply Quote 0
      • M
        mp5gosu
        last edited by mp5gosu

        I'm registering separators like this:

        // Separator
        static const Int32 PID_IM_SEPARATOR = 1000001;
        static const char* PNAME_IM_SEPARATOR = "#$09--"; // For positioning
        
        --
        
        // Separator
        	if (!RegisterCommandPlugin(PID_IM_SEPARATOR, String(PNAME_IM_SEPARATOR), 0, nullptr, ""_s, Command_Settings::Alloc().GetValue()))
        		return false;
        
        

        Where the Alloc routine can be pointing to any already exisiting or a dummy Command plugin, since the separator is not executable.
        edit: Oh and yes, you have to register a custom ID, unfortunately.

        1 Reply Last reply Reply Quote 0
        • a_blockA
          a_block
          last edited by

          Hi,

          yes, this is still the "official" way to add separators to the Plugins menu.

          Cheers,
          Andreas

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