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

**URL:** <https://community.shotgridsoftware.com/t/nuke-publish2-changing-item-context-seems-impossible-breaks-ui/9973>\
**Category:** Pipeline Integrations\
**Created:** [September 9, 2020, 2:37pm UTC](https://community.shotgridsoftware.com/t/nuke-publish2-changing-item-context-seems-impossible-breaks-ui/9973 "2020-09-09T14:37:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ricardo\_Musch](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/ricardo_musch/32/405_2.png) [@Ricardo\_Musch](https://community.shotgridsoftware.com/u/Ricardo_Musch)\
**Post date:** [September 9, 2020, 2:37pm UTC](https://community.shotgridsoftware.com/t/nuke-publish2-changing-item-context-seems-impossible-breaks-ui/9973/1 "2020-09-09T14:37:32Z")

</div>

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:

 ![image](https://global.discourse-cdn.com/shotgunsoftware/original/2X/6/692c44f5c02dca658b3606d0b5db71a21c643269.png)

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](https://global.discourse-cdn.com/shotgunsoftware/original/2X/a/ae719b95af97f4049c18de68cff912b39f513d1e.png)

---

<div class="post-metadata">

**Author:** ![DavidMason](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/davidmason/32/193_2.png) [@DavidMason](https://community.shotgridsoftware.com/u/DavidMason)\
**Post date:** [September 10, 2020, 2:41pm UTC](https://community.shotgridsoftware.com/t/nuke-publish2-changing-item-context-seems-impossible-breaks-ui/9973/2 "2020-09-10T14:41:27Z")

</div>

Hey @Ricardo_Musch,

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

-David

---

<div class="post-metadata">

**Author:** ![Ricardo\_Musch](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/ricardo_musch/32/405_2.png) [@Ricardo\_Musch](https://community.shotgridsoftware.com/u/Ricardo_Musch)\
**Post date:** [September 14, 2020, 1:41pm UTC](https://community.shotgridsoftware.com/t/nuke-publish2-changing-item-context-seems-impossible-breaks-ui/9973/3 "2020-09-14T13:41:56Z")

</div>

```
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
