removing custom script command 2005-06-19 - By Bernard Lebel
Back As far as I'm aware, you cannot create a menu. You can only insert a submenu in an existing menu.
Attached the LightTools menu construction plugin (written in Python), wich I don't use because there is too many items and makes XSI crash every 4 times I click on the Light cell.
Note that having plugins in menus will slow down these menus. With only a handful of menus you will not see any difference, but the more you add, the slower the menu becomes (and potentially unstable).
Cheers Bernard
Stefan Andersson wrote:
>the light became a little dim... :) > >Anyhow, I managed to make my own litte menu in the main window. Next >problem is now to get the plugins in there as submenus. I can only >find examples how to add menus to existing "core" xsi menus, which is >not what I want. > >This is the code I have so far for making the little menu >-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- -- ---- >function XSILoadPlugin( in_reg ) > in_reg.Author = "Stefan Andersson" > in_reg.Name = "Stefan XSI Plugin's" > in_reg.Major = 1 > in_reg.Minor = 0 > in_reg.RegisterMenu siMenuMainTopLevelID,"Stefan",false,false > XSILoadPlugin = true >end function > >function Stefan_Init( io_Context ) > dim oCmd > set oCmd = io_Context.Source > Stefan_Init = true >end function > >function Stefan_Menu_Init( io_Context ) > dim oMenu > set oMenu = io_Context.Source >end function > >-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- -- ---- > >Basicly a lot of cut and paste, with a few adjustments. I found this >in the SDK docs > >"in_reg.RegisterMenu siMenuMainWindowID, "CustomMenuItem", >bDisplayAsSubmenu, bDynamic" > >How can I use my "stefan" menu as a ID? So far all attemps has been >unsuccessful. And I'm searching the docs, but I think I'm looking at >the wrong thing... > >Any pointers will be greatly appreciated. > >regards >stefan > > > >
|
|