Nuke/Publish2 - Changing item context seems impossible/breaks UI

Hiya,

I am trying to change the item’s context in Nuke (the item is unparented) and changing the item.context to a different shot breaks the UI like so:

As you can see I am in a task context on shot A, the render I am trying to publish is for a different shot, so I am generating the context from the path and setting item.context to that.
The code does not error, but the UI breaks.

FYI, the app/settings are available in both the nuke shot and shot_step environements, and I have also tried a hardcoded context_from_entity result with a task to link to, same result.

Logging back the value of the item.context does actually reveal that it has been set as I instructed, but the UI is still broken.

WHY?

Also, if I don’t try to change context it works flawlessly…
image

3 Likes

Hey @Ricardo_Musch,

Is there any info in your debug logs? might point us to why the context is not resetting correctly.

-David

Traceback (most recent call last):
  File "G:\Projects\someproject\_installs\shotgun\someproject-sgtk-closed_beta\install\core\python\tank\platform\engine.py", line 1685, in _create_widget
    widget = derived_widget_class(*args, **kwargs)
  File "G:\Projects\__SGToolkitMasterConfig\_installs\shotgun\__SGToolkitMasterConfig-sgtk-app-dev\__app_development\nl-tk-multi-render-publish-daily\python\tk_multi_publish2\dialog.py", line 268, in __init__
    self._full_rebuild()
  File "G:\Projects\__SGToolkitMasterConfig\_installs\shotgun\__SGToolkitMasterConfig-sgtk-app-dev\__app_development\nl-tk-multi-render-publish-daily\python\tk_multi_publish2\dialog.py", line 826, in _full_rebuild
    new_session_items = self._publish_manager.collect_session()
  File "G:\Projects\__SGToolkitMasterConfig\_installs\shotgun\__SGToolkitMasterConfig-sgtk-app-dev\__app_development\nl-tk-multi-render-publish-daily\python\tk_multi_publish2\api\manager.py", line 190, in collect_session
    self._attach_plugins(new_items)
  File "G:\Projects\__SGToolkitMasterConfig\_installs\shotgun\__SGToolkitMasterConfig-sgtk-app-dev\__app_development\nl-tk-multi-render-publish-daily\python\tk_multi_publish2\api\manager.py", line 438, in _attach_plugins
    context_plugins = self._load_publish_plugins(item_context)
  File "G:\Projects\__SGToolkitMasterConfig\_installs\shotgun\__SGToolkitMasterConfig-sgtk-app-dev\__app_development\nl-tk-multi-render-publish-daily\python\tk_multi_publish2\api\manager.py", line 548, in _load_publish_plugins
    plugin_settings = app_settings[self.CONFIG_PLUGIN_DEFINITIONS]
KeyError: 'publish_plugins'

As far as I can see, it seems to fail to find any publish plugins defined for the context I’m changing to (from shot_step to shot).

However my app settings are currently all in the standard info.yml and not separated by context.
Also the app has been made available in the shot and shot_step environments

1 Like