fix(nk, global): slate workflow on farm and local improvements

This commit is contained in:
Jakub Jezek 2020-02-18 16:30:38 +01:00
parent 20a3e05445
commit 73c94459b8
No known key found for this signature in database
GPG key ID: C4B96E101D2A47F3
3 changed files with 36 additions and 20 deletions

View file

@ -158,7 +158,6 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin):
os.environ.update(session)
instance = metadata.get("instance")
if instance:
instance_family = instance.get("family")
pixel_aspect = instance.get("pixelAspect", 1)
resolution_width = instance.get("resolutionWidth", 1920)
resolution_height = instance.get("resolutionHeight", 1080)
@ -168,7 +167,6 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin):
slate_frame = instance.get("slateFrame")
version = instance.get("version")
else:
# Search in directory
data = dict()
@ -217,6 +215,7 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin):
families.append("render2d")
if families_data and "slate" in families_data:
families.append("slate")
families.append("slate.farm")
if data.get("attachTo"):
# we need to attach found collections to existing

View file

@ -32,6 +32,10 @@ class ExtractBurnin(pype.api.Extractor):
frame_end = int(instance.data.get("frameEnd") or 1)
duration = frame_end - frame_start + 1
if "slate.farm" in instance.data["families"]:
frame_start += 1
duration -= 1
prep_data = {
"username": instance.context.data['user'],
"asset": os.environ['AVALON_ASSET'],
@ -48,22 +52,6 @@ class ExtractBurnin(pype.api.Extractor):
datetime_data = instance.context.data.get("datetimeData") or {}
prep_data.update(datetime_data)
slate_frame_start = frame_start
slate_frame_end = frame_end
slate_duration = duration
# exception for slate workflow
if "slate" in instance.data["families"]:
slate_frame_start = frame_start - 1
slate_frame_end = frame_end
slate_duration = slate_frame_end - slate_frame_start + 1
prep_data.update({
"slate_frame_start": slate_frame_start,
"slate_frame_end": slate_frame_end,
"slate_duration": slate_duration
})
# Update data with template data
template_data = instance.data.get("assumedTemplateData") or {}
prep_data.update(template_data)
@ -111,6 +99,26 @@ class ExtractBurnin(pype.api.Extractor):
filled_anatomy = anatomy.format_all(_prep_data)
_prep_data["anatomy"] = filled_anatomy.get_solved()
# dealing with slates
slate_frame_start = frame_start
slate_frame_end = frame_end
slate_duration = duration
# exception for slate workflow
if ("slate" in instance.data["families"]):
if "slate-frame" in repre.get("tags", []):
slate_frame_start = frame_start - 1
slate_frame_end = frame_end
slate_duration = duration + 1
self.log.debug("__1 slate_frame_start: {}".format(slate_frame_start))
_prep_data.update({
"slate_frame_start": slate_frame_start,
"slate_frame_end": slate_frame_end,
"slate_duration": slate_duration
})
burnin_data = {
"input": full_movie_path.replace("\\", "/"),
"codec": repre.get("codec", []),

View file

@ -44,7 +44,7 @@ class CollectNukeWrites(pyblish.api.InstancePlugin):
frame_length = int(
last_frame - first_frame + 1
)
if node["use_limit"].getValue():
handles = 0
first_frame = int(node["first"].getValue())
@ -89,13 +89,22 @@ class CollectNukeWrites(pyblish.api.InstancePlugin):
frame_start_str = "%0{}d".format(
len(str(last_frame))) % first_frame
representation['frameStart'] = frame_start_str
# in case slate is expected and not yet rendered
self.log.debug("_ frame_length: {}".format(frame_length))
self.log.debug(
"_ collected_frames_len: {}".format(
collected_frames_len))
# this will only run if slate frame is not already
# rendered from previews publishes
if "slate" in instance.data["families"] \
and (frame_length != collected_frames_len):
and (frame_length == collected_frames_len):
frame_slate_str = "%0{}d".format(
len(str(last_frame))) % (first_frame - 1)
slate_frame = collected_frames[0].replace(
frame_start_str, frame_slate_str)
collected_frames.insert(0, slate_frame)
representation['files'] = collected_frames
instance.data["representations"].append(representation)
except Exception: