Custom User Tools Menu Item

To add a new tool, you write an extension with imgui code for the editor and to see the tool in the Tools menu, you need to add the item with editor.addToolsMenuItem like so:

Adding a tool to Tools menu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
-- this function will be called by editor when it constructs the Tools menu
local function onToolsMenuItem()
        -- here you show your tool's window or execute the tool operations
end

local function onEditorInitialized()
        -- if this extension is experimental, you can specify that, it will be placed in Experimental/WIP submenu
    local editorExtensionInfo = {
      experimental = true
    }
    -- add an entry in the Tools menu
        editor.addToolsMenuItem("My Tool", onToolsMenuItem, editorExtensionInfo)
end

M.onEditorInitialized = onEditorInitialized