Merge pull request #3369 from pypeclub/bugfix/OP-2448_Maya-Extract-playblast-fail

Maya - added support for single frame playblast review
This commit is contained in:
Petr Kalis 2022-06-20 16:43:37 +02:00 committed by GitHub
commit bf6c71f07c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View file

@ -111,7 +111,8 @@ class ExtractPlayblast(openpype.api.Extractor):
self.log.debug("playblast path {}".format(path))
collected_files = os.listdir(stagingdir)
collections, remainder = clique.assemble(collected_files)
collections, remainder = clique.assemble(collected_files,
minimum_items=1)
self.log.debug("filename {}".format(filename))
frame_collection = None
@ -134,10 +135,15 @@ class ExtractPlayblast(openpype.api.Extractor):
# Add camera node name to representation data
camera_node_name = pm.ls(camera)[0].getTransform().name()
collected_files = list(frame_collection)
# single frame file shouldn't be in list, only as a string
if len(collected_files) == 1:
collected_files = collected_files[0]
representation = {
'name': 'png',
'ext': 'png',
'files': list(frame_collection),
'files': collected_files,
"stagingDir": stagingdir,
"frameStart": start,
"frameEnd": end,

View file

@ -763,7 +763,8 @@ class ExtractReview(pyblish.api.InstancePlugin):
start_frame = int(start_frame)
end_frame = int(end_frame)
collections = clique.assemble(files)[0]
assert len(collections) == 1, "Multiple collections found."
msg = "Multiple collections {} found.".format(collections)
assert len(collections) == 1, msg
col = collections[0]
# do nothing if no gap is found in input range