On 21/06/2018 at 14:33, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 14
Platform: Mac ;
Language(s) : C++ ;
---------
Hello, I'm trying to get more control of how my plugins look in the Plugins Menu. I want to be able to have different plugins within different folders within the same compile. I was hoping to be able to use the EnhanceMainMenu() example function from the cinema4dsdk examples to achieve this.
So I want to create a folder under Plugins, not in the Menu bar. My current issue is that it always adds the folder, named here "At the Bottom", to the bottom of the Plugins Menu, instead of between the separators. I'd want the folder being inserted above or below "Cinema4dsdk" in this example.
Any help would be appreciated!
My current code:
void EnhanceMainMenu(void)
{
BaseContainer *bc;
bc = SearchPluginMenuResource()->GetContainer();
if (SearchMenuResource(bc,String("PLUGIN_CMD_1000472")))
return;
//I think this is whats wrong, not sure what to do
GeData *last = SearchPluginSubMenuResource(String("IDM_EXECUTE_LAST"));
if (last)
{
BaseContainer sc;
sc.InsData(MENURESOURCE_SUBTITLE,String("SDK Test"));
sc.InsData(MENURESOURCE_COMMAND,String("IDM_NEU")); // add C4D's new scene command to menu
sc.InsData(MENURESOURCE_SEPERATOR,TRUE);
sc.InsData(MENURESOURCE_COMMAND,String("PLUGIN_CMD_1000472")); // add ActiveObject dialog to menu
bc->InsDataAfter(MENURESOURCE_STRING,sc,last);
}
else // user killed plugin menu - add as last overall entry
{
BaseContainer sc;
sc.InsData(MENURESOURCE_SUBTITLE,String("At the Bottom"));//To show that it's not working
sc.InsData(MENURESOURCE_COMMAND,String("IDM_NEU")); // add C4D's new scene command to menu
sc.InsData(MENURESOURCE_SEPERATOR,TRUE);
sc.InsData(MENURESOURCE_COMMAND,String("PLUGIN_CMD_1000472")); // add ActiveObject dialog to menu
bc->InsData(MENURESOURCE_STRING,sc);
}
}