Enumerate menu commands



  • On 12/04/2013 at 03:39, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   R14+ 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    Is there a way to enumerate the commands available to the use?

    I can think of a brute force method but is there something which will give me something like the menu structure?

    markus



  • On 12/04/2013 at 05:39, xxxxxxxx wrote:

    Hi Markus and welcome,

    You can get all the Command or Menu plugins calling FilterPluginList() with type PLUGINTYPE_COMMAND.

    Also, GetMenuResource() gives you the menu resource container of the given menu editor name.
    You can find here some code showing how to use this function and browse through the menus of CINEMA.



  • On 15/04/2013 at 06:06, xxxxxxxx wrote:

    Thanks Yannick.

    Following your suggestion I can get the plug-in command ids (by casting to a baseplugin* ) and then get their names, help etc. or I can browse a menu resource.

    What I appear to be currently missing/cannot find are two things

    GetMenuResource() requires a string menu name. Where do these menu names come from? Can these be enumerated somewhere?

    The Id's returned by using the BrowseContainer are strings such as "IDS_RECENT" or "PLUGIN_CMD_1234567". How can these be converted to a long ID so that they can be used in
    GetCommandName() ?

    Similarly how does one obtain the the localized text for "IDS_EDITOR_FILE"?

    Markus



  • On 15/04/2013 at 08:36, xxxxxxxx wrote:

    Hi Markus,

    Originally posted by xxxxxxxx

    GetMenuResource() requires a string menu name. Where do these menu names come from? Can these be enumerated somewhere?

    CINEMA main menus identifiers beginning with "M_" are defined in c4d_symbols.h.
    The easiest way to see all the available IDs is to open the dialog for menus customization (Customization -> Customize Menus). The combo box list them all.

    Originally posted by xxxxxxxx

    The Id's returned by using the BrowseContainer are strings such as "IDS_RECENT" or "PLUGIN_CMD_1234567". How can these be converted to a long ID so that they can be used in 
    GetCommandName()?
    Similarly how does one obtain the localized text for "IDS_EDITOR_FILE"?

    For "PLUGIN_CMD_1234567" you can parse the string and get the the number at the end representing the command ID.
    In the case of "IDS_RECENT", "IDS_EDITOR_FILE" or "IDM_NEU" I haven't found any convenient function in the API. I'll ask the developers.



  • On 30/04/2013 at 03:43, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    In the case of "IDS_RECENT", "IDS_EDITOR_FILE" or "IDM_NEU" I haven't found any convenient function in the API. I'll ask the developers.
    [/QUOTE]

    Hi Yannick,

    Have the developers been able to come back with anything useful, yet?

    Markus



  • On 30/04/2013 at 05:21, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    Originally posted by xxxxxxxx

    In the case of "IDS_RECENT", "IDS_EDITOR_FILE" or "IDM_NEU" I haven't found any convenient function in the API. I'll ask the developers.

    Have the developers been able to come back with anything useful, yet?

    Hi Markus,

    The only way to find the IDs for these menus is to parse resource\c4d_symbols.h
    _
    _
    _
    _


Log in to reply