Hi,
It looks like you're very close to a working solution. The .py file needs to be installed in a location on $GAFFER_STARTUP_PATHS, such as the gaffer/startup/gui folder in your user home directory, and you'll need to modify the following line:
`GafferUI.ScriptWindow.menuDefinition().append(`
to provide `application` to menuDefinition() so that you're modifying the menuDefinition for the current application:
`GafferUI.ScriptWindow.menuDefinition( application ).append(`
For more background, you can find a bit more info in the
startup config tutorials, and in this blog post about Gaffer's app structure and startup configs:
https://blog.gafferhq.org/?p=210Cheers,
Murray
---
def test_function(menu):
print("Test menu item selected")
GafferUI.ScriptWindow.menuDefinition( application ).append(
"/Test/Version Up",
{
"command": functools.partial(test_function),
"label": "Version Up",
"shortCut": ""
}
)