Hey, how do we add tk-shotgun actions for new entities (e.g. a Playlist or a Custom Entity)?
i.e. How do we add Shotgun Toolkit actions to the “Playlist Actions” dropdown on the Playlist detail page in Shotgun?
I found this write-up on the forum. It appears to lay out adding a custom entity to the Shotgun Desktop tools, but doesn’t include adding actions to tk-shotgun.
Attempting to do this for the Playlist Entity, I did the following…
Create config/env/playlist.yml to match config/env/version.yml
Add settings.tk-shotgun.playlist entry to config/env/includes/settings/tk-shotgun.yml
However, when I go to the Playlist detail page, there’s nothing new listed in the Playlist Actions menu.
It’s on my to-do list to add this to the documentation for Toolkit browser integration, but there are some limitations to which entities can have right-click menus assigned to them:
Either they have to be part of this hard-coded list:
Or, they have to have Publishes enabled on the entity in your Site Prefs (under the “Entities” header):
Hey Josh, I am working on the same thing as you right now, I think that you can create an env called “shotgun_playlist.yml” that it should pick up in tk-shotgun. That’s what the code seems to say but I haven’t much luck with getting it actually working.
Thanks, @Ahuge. I tried that, too, and had a similar lack of results.
@tannaz, I created a local fork of tk-framework-desktopserver and updated the constants.py file as you described. (Then, I added the framework to my config’s local bundle-cache and updated the frameworks.yml, as expected.) However, I didn’t see my new menu actions in the Shotgun UI.
Hi @JoshBurnell the custom framework would need to be updated on the site config, as SG Desktop starts the browser integration outside of a project.
Do you have a site config already which you can add it to?
If not you would add a PipelineConfiguration entity on your shotgun site with no Project set and uses your modified version of the tk-config-basic.
I have multiple PipelineConfiguration entities on my Shotgun Site with no Project set (e.g. “Master” and “Staging”). Which one will be used as the site config?
Yikes, this was a nice big gotcha for me recently when we had the need to enable an action on a Delivery entity. I was trying to find any an all docs on this matter but the main place for this info seemed to be lacking this information. This thread was the only hit, that had the bingo moment.
If this is ever seen, I recommend the docs here are extended to include toolkit based action menus / apps / tk-shotgun commands, and this fun little fact is mentioned.
Hi @philip.scadding, I am doing the exact same thing as Josh and I am unable to get the app show up in the context menu for a Playlist entity. I am using the latest version (v1.5.2) for tk-framework-desktopserver and I see that the Playlist has now been added to the constants. Right clicking for the context menu on a Playlist entity on shotgrid does not even trigger anything whereas if I add the app to Version entity, I can see the pick_environment.py being called and I see the Version entity as the context.
I have done all the other updates - created a playlist.yml (we didn’t have this before), added an entry in the tk-shotgun.yml, and created the add.yml with all of the correct details. The app shows up for a Version entity, and if I add it to the Project entity, it shows up in the Project Actions drop-down as well.