Toolkit context menu items

Hello,

Is it possible, if so how, to add items to the Toolkit list in the entity right-click context menus?

Screen Shot 2020-04-29 at 11.53.08 AM copy

I tried adding {"type": "context_menu"} to the register_command on the engine, but that put my app in the Toolkit menu next to “Reload and Restart” and “Shotgun Python Console”. Is there a way to get it to the context menus for a given entity?

2 Likes

You are probably thinking of Action Menu Items

2 Likes

No, these are Toolkit items which show up in the context menu along side of the list AMIs. The little grey/green icon is the Toolkit icon and is written by SG without the need for any AMI service setup.

1 Like

Those context items are shown based on the settings of the shotgun engine for that entity.
You can add apps in shotgun.yml and any commands they have should show up.

I have had issues where those menus are cached and adding new commands to apps doesn’t cause the menu to rebuild itself.

2 Likes

Oh, that’s pretty cool, did not realize these come from the engine commands.

Is how to add/update these context menu items anywhere in the SG documentation?

1 Like

We don’t call them out specifically in the docs, as @jhultgre mentions, its just a case of adding the app to the tk-shotgun engine, like you would add it to the tk-desktop engine or any other engine.

However I’ll mention this to the team to see if there is a suitable place to mention this in our docs.

2 Likes

Cool! Do you happen to have an example of how/if I would be able to do this using the tk-config-basic setup?

1 Like

Sure!
So the tk-shotgun engine is added to all the root environment ymls for example:

and these point to:

And that is where the apps are being defined in the tk-shotgun engine.
So you just need to add your app definition/settings to that file and it should show up.

3 Likes

Thanks @philip.scadding, I can see what @jhultgre was saying about load reliability. I tried to add an App that we are hosting as an sg_uploaded_app on our SG site. It did not show up right away so I took that one out and tried adding one hosted locally using a dev descriptor. Then the first one with the ToolkitApp showed up, and it was not even in the config anymore. So, I cleared the browsing data and tried to load the SG pythonconsole from the app_store and all that managed to do was crash my Toolkit. LoL I have a feeling it is just a syntax issue with my descriptors.

1 Like

Yeah that is something that is on the list to document better as well.
That behaviour is expected though.
Basically on page load, it loads the cached items so that is it quick, and then sets about updating the cache if needed. So basically you need a double reload to see the changes.

It is a bit frustrating when testing things out, but its the trade off to allow quicker generation of menu items for the end user.