From 06e11a45c20740307a45273ee236d44f3272d55c Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 15 Feb 2023 15:17:39 +0100 Subject: [PATCH] removed legacy creator --- openpype/hosts/tvpaint/api/plugin.py | 47 ++-------------------------- 1 file changed, 3 insertions(+), 44 deletions(-) diff --git a/openpype/hosts/tvpaint/api/plugin.py b/openpype/hosts/tvpaint/api/plugin.py index 397e4295f5..64784bfb83 100644 --- a/openpype/hosts/tvpaint/api/plugin.py +++ b/openpype/hosts/tvpaint/api/plugin.py @@ -1,21 +1,15 @@ import re -import uuid -from openpype.pipeline import ( - LegacyCreator, - LoaderPlugin, - registered_host, -) +from openpype.pipeline import LoaderPlugin from openpype.pipeline.create import ( CreatedInstance, get_subset_name, AutoCreator, - Creator as NewCreator, + Creator, ) from openpype.pipeline.create.creator_plugins import cache_and_get_instances from .lib import get_layers_data -from .pipeline import get_current_workfile_context SHARED_DATA_KEY = "openpype.tvpaint.instances" @@ -86,7 +80,7 @@ class TVPaintCreatorCommon: ) -class TVPaintCreator(NewCreator, TVPaintCreatorCommon): +class TVPaintCreator(Creator, TVPaintCreatorCommon): def collect_instances(self): self._collect_create_instances() @@ -147,41 +141,6 @@ class TVPaintAutoCreator(AutoCreator, TVPaintCreatorCommon): return self._custom_get_subset_name(*args, **kwargs) -class Creator(LegacyCreator): - def __init__(self, *args, **kwargs): - super(Creator, self).__init__(*args, **kwargs) - # Add unified identifier created with `uuid` module - self.data["uuid"] = str(uuid.uuid4()) - - @classmethod - def get_dynamic_data(cls, *args, **kwargs): - dynamic_data = super(Creator, cls).get_dynamic_data(*args, **kwargs) - - # Change asset and name by current workfile context - workfile_context = get_current_workfile_context() - asset_name = workfile_context.get("asset") - task_name = workfile_context.get("task") - if "asset" not in dynamic_data and asset_name: - dynamic_data["asset"] = asset_name - - if "task" not in dynamic_data and task_name: - dynamic_data["task"] = task_name - return dynamic_data - - def write_instances(self, data): - self.log.debug( - "Storing instance data to workfile. {}".format(str(data)) - ) - host = registered_host() - return host.write_instances(data) - - def process(self): - host = registered_host() - data = host.list_instances() - data.append(self.data) - self.write_instances(data) - - class Loader(LoaderPlugin): hosts = ["tvpaint"]