Hiero: workfile plugins

This commit is contained in:
Jakub Jezek 2021-04-29 12:46:53 +02:00
parent a8482213fa
commit c70ef75042
No known key found for this signature in database
GPG key ID: D8548FBF690B100A
2 changed files with 1 additions and 51 deletions

View file

@ -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))

View file

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