From 70537ecfd441d30d12df3ecde4b4f2fba0b14337 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Mon, 21 Feb 2022 19:00:50 +0100 Subject: [PATCH] moved io install into host api --- openpype/hosts/traypublisher/api/pipeline.py | 7 +++---- openpype/tools/traypublisher/window.py | 5 ----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/openpype/hosts/traypublisher/api/pipeline.py b/openpype/hosts/traypublisher/api/pipeline.py index 83fe326ca4..a39e5641ae 100644 --- a/openpype/hosts/traypublisher/api/pipeline.py +++ b/openpype/hosts/traypublisher/api/pipeline.py @@ -3,6 +3,7 @@ import json import tempfile import atexit +from avalon import io import avalon.api import pyblish.api @@ -172,10 +173,8 @@ def install(): def set_project_name(project_name): - # Deregister project specific plugins and register new project plugins - old_project_name = HostContext.get_project_name() - if old_project_name is not None and old_project_name != project_name: - pass + # TODO Deregister project specific plugins and register new project plugins os.environ["AVALON_PROJECT"] = project_name avalon.api.Session["AVALON_PROJECT"] = project_name + io.install() HostContext.set_project_name(project_name) diff --git a/openpype/tools/traypublisher/window.py b/openpype/tools/traypublisher/window.py index 34ba042e91..fc9493be0a 100644 --- a/openpype/tools/traypublisher/window.py +++ b/openpype/tools/traypublisher/window.py @@ -6,11 +6,9 @@ Tray publisher can be considered as host implementeation with creators and publishing plugins. """ -import os from Qt import QtWidgets, QtCore import avalon.api -from avalon import io from avalon.api import AvalonMongoDB from openpype.hosts.traypublisher import ( api as traypublisher @@ -143,9 +141,6 @@ class TrayPublishWindow(PublisherWindow): # TODO register project specific plugin paths self.controller.save_changes() self.controller.reset_project_data_cache() - os.environ["AVALON_PROJECT"] = project_name - io.Session["AVALON_PROJECT"] = project_name - io.install() self.reset() if not self.controller.instances: