From c70ef75042080ae0b208b1daa01c6ba20c5e5ecd Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 29 Apr 2021 12:46:53 +0200 Subject: [PATCH] Hiero: workfile plugins --- .../hiero/plugins/publish/extract_workfile.py | 50 ------------------- .../integrate_version_up_workfile.py} | 2 +- 2 files changed, 1 insertion(+), 51 deletions(-) delete mode 100644 openpype/hosts/hiero/plugins/publish/extract_workfile.py rename openpype/hosts/hiero/plugins/{publish_old_workflow/version_up_workfile.py => publish/integrate_version_up_workfile.py} (90%) diff --git a/openpype/hosts/hiero/plugins/publish/extract_workfile.py b/openpype/hosts/hiero/plugins/publish/extract_workfile.py deleted file mode 100644 index e3d60465a2..0000000000 --- a/openpype/hosts/hiero/plugins/publish/extract_workfile.py +++ /dev/null @@ -1,50 +0,0 @@ -import os -import pyblish.api -import openpype.api -from openpype.hosts import resolve - - -class ExtractWorkfile(openpype.api.Extractor): - """ - Extractor export DRP workfile file representation - """ - - label = "Extract Workfile" - order = pyblish.api.ExtractorOrder - families = ["workfile"] - hosts = ["resolve"] - - def process(self, instance): - # create representation data - if "representations" not in instance.data: - instance.data["representations"] = [] - - name = instance.data["name"] - project = instance.context.data["activeProject"] - staging_dir = self.staging_dir(instance) - - resolve_workfile_ext = ".drp" - drp_file_name = name + resolve_workfile_ext - drp_file_path = os.path.normpath( - os.path.join(staging_dir, drp_file_name)) - - # write out the drp workfile - resolve.get_project_manager().ExportProject( - project.GetName(), drp_file_path) - - # create drp workfile representation - representation_drp = { - 'name': resolve_workfile_ext[1:], - 'ext': resolve_workfile_ext[1:], - 'files': drp_file_name, - "stagingDir": staging_dir, - } - - instance.data["representations"].append(representation_drp) - - # add sourcePath attribute to instance - if not instance.data.get("sourcePath"): - instance.data["sourcePath"] = drp_file_path - - self.log.info("Added Resolve file representation: {}".format( - representation_drp)) diff --git a/openpype/hosts/hiero/plugins/publish_old_workflow/version_up_workfile.py b/openpype/hosts/hiero/plugins/publish/integrate_version_up_workfile.py similarity index 90% rename from openpype/hosts/hiero/plugins/publish_old_workflow/version_up_workfile.py rename to openpype/hosts/hiero/plugins/publish/integrate_version_up_workfile.py index ae03513d78..934e7112fa 100644 --- a/openpype/hosts/hiero/plugins/publish_old_workflow/version_up_workfile.py +++ b/openpype/hosts/hiero/plugins/publish/integrate_version_up_workfile.py @@ -2,7 +2,7 @@ from pyblish import api import openpype.api as pype -class VersionUpWorkfile(api.ContextPlugin): +class IntegrateVersionUpWorkfile(api.ContextPlugin): """Save as new workfile version""" order = api.IntegratorOrder + 10.1