Shotgun publisher -- Episode Link

I’m trying to get the desktop publisher to recognize a task linked to an Episode. If I try to select the episode in the Link dropdown the context shows up as none.

Is it possible to get the publisher to set the link as episode and detect the task? How would I go about implementing this?

Thanks!

4 Likes

Hi @StarkRavenSimone, thanks for posting! Just moving this over to the Pipeline Integrations Category to get more relevant eyes on the question.

1 Like

I think unfortunately this is likely a bug. Currently it shows up as None if there haven’t been folder created for that entity.
I assume you haven’t created folders for the episode, or maybe don’t even have episodes in your Toolkit schema?

2 Likes

I’ve been playing around with this a bit more and found that I can select the task with the episode link and it does properly link to the episode in the publisher.
What I’m still struggling with is trying to get it to automatically detect the context from the file name.
For instance, I have a string template set up to collect the episode name and pipeline step from the filename which is sufficient to find the task. However when the manager.py script proceeds to _load_publish_plugins step I get this error

Engine tk-desktop cannot initialize - the pick environment hook was not able to return an environment to use, given the context Scriptwriting, Episode 116. Usually this is because the context contains insufficient information for an environment to be determined.

Do I not have a proper configuration environment set up for Episodes, perhaps? I’m unable to get much more useful information out of the method that raised the error.

Thanks!

1 Like

As a follow-up. I’d be curious to know what method is doing the context selection when a task is chosen in the publisher UI. If I could see what data its gathering to find the proper context, perhaps I can use it to modify the way I’m trying to get the context automatically.

1 Like

Do I not have a proper configuration environment set up for Episodes, perhaps?

So if you set the context on the collected item at collection time, then it will try to load the publish plugins from the environment yamls that match the context on the item, whilst I think this behaviour makes sense, it does usually catch people out.

This doc explains how the environments work. But basically it sounds like you don’t have an environment yaml file for your episode context containing the relevant engine and publish app settings.

Yeah, so this actually another rough edge. The difference between setting the context on the item during collection, and the user setting it via the context picker is that, as mentioned above if you set it during collection it will search for the plugins in the environment that matches the context. Whereas when you pick it from the context picker, this is after collection time, and so it doesn’t re-evaluate what plugins should be available, so in fact just uses the plugins from the environment that matched the item’s context originally, which by default would be the current engine context.

We have talked about changing this behaviour and do have a ticket logged to do so, but it’s not so straight forward.
Consider this, if you change the context of an item via a plugin, in the plugin’s UI panel, then potentially this new context might point to an environment with different plugins, so the plugins could change each time you pick/change the context on an item. Now if the plugin itself changed the context then it could actually be throwing it’s self away, and even if the plugin did exist in the new environment, we would need to track if it was the same as the previous plugin so we could preserve any settings the user might have entered, but the plugin might actually have different configured settings in this new environment so which would take precedence?

1 Like

Looks like I just missed a few changes to my environments to get it to work. Needed to modify the pick_environment hook and add and episodic entity yml file.
Works now, though.

Thanks!

2 Likes