switch from 'files' to 'representations' integrator process

This commit is contained in:
Milan Kolar 2019-05-24 01:13:17 +02:00
parent 15cf520096
commit c5d0f19385
12 changed files with 118 additions and 45 deletions

View file

@ -20,7 +20,7 @@ class ExtractAlembic(pype.api.Extractor):
# Get the filename from the filename parameter
output = ropnode.evalParm("filename")
staging_dir = os.path.dirname(output)
instance.data["stagingDir"] = staging_dir
# instance.data["stagingDir"] = staging_dir
file_name = os.path.basename(output)
@ -37,7 +37,13 @@ class ExtractAlembic(pype.api.Extractor):
traceback.print_exc()
raise RuntimeError("Render failed: {0}".format(exc))
if "files" not in instance.data:
instance.data["files"] = []
if "representations" not in instance.data:
instance.data["representations"] = []
instance.data["files"].append(file_name)
representation = {
'name': 'abc',
'ext': '.abc',
'files': file_name,
"stagingDir": staging_dir,
}
instance.data["representations"].append(representation)

View file

@ -37,16 +37,19 @@ class CollectMayaScene(pyblish.api.ContextPlugin):
"label": subset,
"publish": False,
"family": 'workfile',
"representation": "ma",
"setMembers": [current_file],
"stagingDir": folder
"setMembers": [current_file]
})
data['files'] = [file]
data['representations'] = [{
'name': 'ma',
'ext': '.ma',
'files': file,
"stagingDir": folder,
}]
instance.data.update(data)
self.log.info('Collected instance: {}'.format(file))
self.log.info('Scene path: {}'.format(current_file))
self.log.info('stagin Dir: {}'.format(folder))
self.log.info('subset: {}'.format(filename))
self.log.info('staging Dir: {}'.format(folder))
self.log.info('subset: {}'.format(subset))

View file

@ -77,9 +77,15 @@ class ExtractAnimation(pype.api.Extractor):
endFrame=end,
**options)
if "files" not in instance.data:
instance.data["files"] = list()
if "representations" not in instance.data:
instance.data["representations"] = []
instance.data["files"].append(filename)
representation = {
'name': 'abc',
'ext': '.abc',
'files': filename,
"stagingDir": dirname,
}
instance.data["representations"].append(representation)
self.log.info("Extracted {} to {}".format(instance, dirname))

View file

@ -21,8 +21,8 @@ class ExtractAssStandin(pype.api.Extractor):
def process(self, instance):
staging_dir = self.staging_dir(instance)
file_name = "{}.ass".format(instance.name)
file_path = os.path.join(staging_dir, file_name)
filename = "{}.ass".format(instance.name)
file_path = os.path.join(staging_dir, filename)
# Write out .ass file
self.log.info("Writing: '%s'" % file_path)
@ -37,11 +37,16 @@ class ExtractAssStandin(pype.api.Extractor):
boundingBox=True
)
if "representations" not in instance.data:
instance.data["representations"] = []
if "files" not in instance.data:
instance.data["files"] = list()
instance.data["files"].append(file_name)
representation = {
'name': 'ass',
'ext': '.ass',
'files': filename,
"stagingDir": staging_dir
}
instance.data["representations"].append(representation)
self.log.info("Extracted instance '%s' to: %s"
% (instance.name, staging_dir))

View file

@ -33,7 +33,6 @@ class ExtractAssProxy(pype.api.Extractor):
else:
yield
# Define extract output file path
stagingdir = self.staging_dir(instance)
filename = "{0}.ma".format(instance.name)
@ -64,10 +63,15 @@ class ExtractAssProxy(pype.api.Extractor):
expressions=False,
constructionHistory=False)
if "representations" not in instance.data:
instance.data["representations"] = []
if "files" not in instance.data:
instance.data["files"] = list()
instance.data["files"].append(filename)
representation = {
'name': 'ma',
'ext': '.ma',
'files': filename,
"stagingDir": stagingdir
}
instance.data["representations"].append(representation)
self.log.info("Extracted instance '%s' to: %s" % (instance.name, path))

View file

@ -70,10 +70,16 @@ class ExtractCameraAlembic(pype.api.Extractor):
with avalon.maya.suspended_refresh():
cmds.AbcExport(j=job_str, verbose=False)
if "files" not in instance.data:
instance.data["files"] = list()
if "representations" not in instance.data:
instance.data["representations"] = []
instance.data["files"].append(filename)
representation = {
'name': 'abc',
'ext': '.abc',
'files': filename,
"stagingDir": dir_path,
}
instance.data["representations"].append(representation)
self.log.info("Extracted instance '{0}' to: {1}".format(
instance.name, path))

View file

@ -168,10 +168,16 @@ class ExtractCameraMayaAscii(pype.api.Extractor):
massage_ma_file(path)
if "files" not in instance.data:
instance.data["files"] = list()
if "representations" not in instance.data:
instance.data["representations"] = []
instance.data["files"].append(filename)
representation = {
'name': 'ma',
'ext': '.ma',
'files': filename,
"stagingDir": dir_path,
}
instance.data["representations"].append(representation)
self.log.info("Extracted instance '{0}' to: {1}".format(
instance.name, path))

View file

@ -51,9 +51,15 @@ class ExtractMayaAsciiRaw(pype.api.Extractor):
constraints=True,
expressions=True)
if "files" not in instance.data:
instance.data["files"] = list()
if "representations" not in instance.data:
instance.data["representations"] = []
instance.data["files"].append(filename)
representation = {
'name': 'ma',
'ext': '.ma',
'files': filename,
"stagingDir": dir_path
}
instance.data["representations"].append(representation)
self.log.info("Extracted instance '%s' to: %s" % (instance.name, path))

View file

@ -69,9 +69,15 @@ class ExtractModel(pype.api.Extractor):
# Store reference for integration
if "files" not in instance.data:
instance.data["files"] = list()
if "representations" not in instance.data:
instance.data["representations"] = []
instance.data["files"].append(filename)
representation = {
'name': 'ma',
'ext': '.ma',
'files': filename,
"stagingDir": stagingdir,
}
instance.data["representations"].append(representation)
self.log.info("Extracted instance '%s' to: %s" % (instance.name, path))

View file

@ -79,9 +79,15 @@ class ExtractAlembic(pype.api.Extractor):
endFrame=end,
**options)
if "files" not in instance.data:
instance.data["files"] = list()
if "representations" not in instance.data:
instance.data["representations"] = []
instance.data["files"].append(filename)
representation = {
'name': 'abc',
'ext': '.abc',
'files': filename,
"stagingDir": dirname
}
instance.data["representations"].append(representation)
self.log.info("Extracted {} to {}".format(instance, dirname))

View file

@ -123,9 +123,21 @@ class ExtractQuicktime(pype.api.Extractor):
self.log.error(ffmpeg_error)
raise RuntimeError(ffmpeg_error)
if "files" not in instance.data:
instance.data["files"] = list()
instance.data["files"].append(movieFile)
if "representations" not in instance.data:
instance.data["representations"] = []
representation = {
'name': 'mov',
'ext': '.mov',
'files': movieFile,
"stagingDir": stagingdir,
'startFrame': start,
'endFrame': end,
'frameRate': fps,
'preview': True
}
instance.data["representations"].append(representation)
@contextlib.contextmanager

View file

@ -34,9 +34,16 @@ class ExtractRig(pype.api.Extractor):
expressions=True,
constructionHistory=True)
if "files" not in instance.data:
instance.data["files"] = list()
if "representations" not in instance.data:
instance.data["representations"] = []
representation = {
'name': 'ma',
'ext': '.ma',
'files': filename,
"stagingDir": dir_path
}
instance.data["representations"].append(representation)
instance.data["files"].append(filename)
self.log.info("Extracted instance '%s' to: %s" % (instance.name, path))