From ec6654455e24f9a87da3f57c9d98fd9db5fd86fd Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Wed, 2 Nov 2022 18:56:55 +0100 Subject: [PATCH] OP-3908 - remove initialization of PhotoshopHost Initialization might be expensive, use self.host instead. --- openpype/hosts/photoshop/plugins/create/create_image.py | 2 +- openpype/hosts/photoshop/plugins/create/workfile_creator.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/photoshop/plugins/create/create_image.py b/openpype/hosts/photoshop/plugins/create/create_image.py index a6ef8d14df..c352965df8 100644 --- a/openpype/hosts/photoshop/plugins/create/create_image.py +++ b/openpype/hosts/photoshop/plugins/create/create_image.py @@ -123,7 +123,7 @@ class ImageCreator(Creator): def remove_instances(self, instances): for instance in instances: - PhotoshopHost().remove_instance(instance) + self.host.remove_instance(instance) self._remove_instance_from_context(instance) def get_default_variants(self): diff --git a/openpype/hosts/photoshop/plugins/create/workfile_creator.py b/openpype/hosts/photoshop/plugins/create/workfile_creator.py index 5ad9fbaa88..087d5a8a3f 100644 --- a/openpype/hosts/photoshop/plugins/create/workfile_creator.py +++ b/openpype/hosts/photoshop/plugins/create/workfile_creator.py @@ -5,8 +5,6 @@ from openpype.pipeline import ( CreatedInstance, legacy_io ) -from openpype.hosts.photoshop.api import PhotoshopHost - class PSWorkfileCreator(AutoCreator): identifier = "workfile" @@ -18,7 +16,7 @@ class PSWorkfileCreator(AutoCreator): return [] def collect_instances(self): - for instance_data in PhotoshopHost().list_instances(): + for instance_data in self.host.list_instances(): creator_id = instance_data.get("creator_identifier") if creator_id == self.identifier: subset_name = instance_data["subset"]