Add tk-shotgun actions for Playlist or Custom Entity

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…

  1. Create config/env/playlist.yml to match config/env/version.yml
  2. 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.

Any advice?

2 Likes

Hey Josh!

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):

So if you go ahead and enable publishes on your entity, the right-click menus should show up.

Hope that helps! Let us know if you have any other questions.

2 Likes

The Playlist entity doesn’t show the “Enable Pipeline Toolkit/File Publishes on this Entity” checkbox.

It seems like a pretty foundational Entity for people. Is there any reason it isn’t in the BASE_ENTITY_TYPE_WHITELIST by default? Can it be added?

1 Like

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.

1 Like

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.

Any idea what I’m doing wrong?

2 Likes

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.

1 Like

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?

2 Likes

this might help:

1 Like

Okay, I got it to work. For posterity, here’s what I did:

  1. Remove myself from the permissions list of all the non-Project Pipeline Configurations
  2. Create a distributed Pipeline Configuration that isn’t associated with any Projects
  3. Add tk-framework-desktopserver from https://github.com/shotgunsoftware/tk-framework-desktopserver/tree/v1.3.9 to the new Pipeline Configuration’s local bundle_cache
  4. Add Playlist to the whitelist in tk_framework_desktopserver/shotgun/constants.py
  5. Create env/shotgun_playlist.yml (Use env/version.yml as a template)
  6. Update env/includes/frameworks.yml to use the local tk-framework-desktopserver
  7. Now, in your Project Pipeline Configuration, add a Playlist action section to env/includes/settings/tk-shotgun.yml

Simple! :stuck_out_tongue:

2 Likes