Merge remote-tracking branch 'origin/feature/PYPE-323-consolidate_integrator' into feature/PYPE-316-muster-render-support

This commit is contained in:
antirotor 2019-05-29 17:34:40 +02:00
commit f20f47db67
114 changed files with 2812 additions and 2051 deletions

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

@ -146,9 +146,9 @@ class ExtractFBX(pype.api.Extractor):
cmds.loadPlugin("fbxmaya", quiet=True)
# Define output path
directory = self.staging_dir(instance)
stagingDir = self.staging_dir(instance)
filename = "{0}.fbx".format(instance.name)
path = os.path.join(directory, filename)
path = os.path.join(stagingDir, filename)
# The export requires forward slashes because we need
# to format it into a string in a mel expression
@ -208,9 +208,16 @@ class ExtractFBX(pype.api.Extractor):
cmds.select(members, r=1, noExpand=True)
mel.eval('FBXExport -f "{}" -s'.format(path))
if "files" not in instance.data:
instance.data["files"] = list()
if "representations" not in instance.data:
instance.data["representations"] = []
representation = {
'name': 'mov',
'ext': '.mov',
'files': filename,
"stagingDir": stagingDir,
}
instance.data["representations"].append(representation)
instance.data["files"].append(filename)
self.log.info("Extract FBX successful to: {0}".format(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))

View file

@ -110,9 +110,9 @@ class ExtractThumbnail(pype.api.Extractor):
"depthOfField": cmds.getAttr("{0}.depthOfField".format(camera)),
}
stagingdir = self.staging_dir(instance)
stagingDir = self.staging_dir(instance)
filename = "{0}".format(instance.name)
path = os.path.join(stagingdir, filename)
path = os.path.join(stagingDir, filename)
self.log.info("Outputting images to %s" % path)
@ -131,51 +131,19 @@ class ExtractThumbnail(pype.api.Extractor):
_, thumbnail = os.path.split(playblast)
self.log.info("file list {}".format(thumbnail))
# self.log.info("Calculating HUD data overlay")
# stagingdir = "C:/Users/milan.kolar/AppData/Local/Temp/pyblish_tmp_ucsymm"
# collected_frames = os.listdir(stagingdir)
# collections, remainder = clique.assemble(collected_frames)
# input_path = os.path.join(stagingdir, collections[0].format('{head}{padding}{tail}'))
# self.log.info("input {}".format(input_path))
if "representations" not in instance.data:
instance.data["representations"] = []
# movieFile = filename + ".mov"
# full_movie_path = os.path.join(stagingdir, movieFile)
# self.log.info("output {}".format(full_movie_path))
# fls = [os.path.join(stagingdir, filename).replace("\\","/") for f in os.listdir( dir_path ) if f.endswith(preset['compression'])]
# self.log.info("file list {}}".format(fls[0]))
representation = {
'name': 'thumbnail',
'ext': '.jpg',
'files': thumbnail,
"stagingDir": stagingDir,
"thumbnail": True
}
instance.data["representations"].append(representation)
# out, err = (
# ffmpeg
# .input(input_path, framerate=25)
# .output(full_movie_path)
# .run(overwrite_output=True)
# )
if "files" not in instance.data:
instance.data["files"] = list()
instance.data["files"].append(thumbnail)
# ftrackStrings = fStrings.annotationData()
# nData = ftrackStrings.niceData
# nData['version'] = instance.context.data('version')
# fFrame = int(pm.playbackOptions( q = True, minTime = True))
# eFrame = int(pm.playbackOptions( q = True, maxTime = True))
# nData['frame'] = [(str("{0:05d}".format(f))) for f in range(fFrame, eFrame + 1)]
# soundOfst = int(float(nData['oFStart'])) - int(float(nData['handle'])) - fFrame
# soundFile = mu.giveMePublishedAudio()
# self.log.info("SOUND offset %s" % str(soundOfst))
# self.log.info("SOUND source video to %s" % str(soundFile))
# ann = dHUD.draftAnnotate()
# if soundFile:
# ann.addAnotation(seqFls = fls, outputMoviePth = movieFullPth, annotateDataArr = nData, soundFile = soundFile, soundOffset = soundOfst)
# else:
# ann.addAnotation(seqFls = fls, outputMoviePth = movieFullPth, annotateDataArr = nData)
# for f in fls:
# os.remove(f)
# playblast = (ann.expPth).replace("\\","/")
@contextlib.contextmanager

View file

@ -54,10 +54,16 @@ class ExtractVRayProxy(pype.api.Extractor):
ignoreHiddenObjects=True,
createProxyNode=False)
if "files" not in instance.data:
instance.data["files"] = list()
if "representations" not in instance.data:
instance.data["representations"] = []
instance.data["files"].append(file_name)
representation = {
'name': 'vrmesh',
'ext': '.vrmesh',
'files': file_name,
"stagingDir": staging_dir,
}
instance.data["representations"].append(representation)
self.log.info("Extracted instance '%s' to: %s"
% (instance.name, staging_dir))