mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Merged in hotfix/PYPE-730-nk-publishing-slate-workflow-im (pull request #502)
Hotfix/PYPE-730 nk publishing slate workflow im Approved-by: Milan Kolar <milan@orbi.tools>
This commit is contained in:
commit
4ac4fae914
5 changed files with 64 additions and 22 deletions
|
|
@ -158,7 +158,6 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin):
|
||||||
os.environ.update(session)
|
os.environ.update(session)
|
||||||
instance = metadata.get("instance")
|
instance = metadata.get("instance")
|
||||||
if instance:
|
if instance:
|
||||||
instance_family = instance.get("family")
|
|
||||||
pixel_aspect = instance.get("pixelAspect", 1)
|
pixel_aspect = instance.get("pixelAspect", 1)
|
||||||
resolution_width = instance.get("resolutionWidth", 1920)
|
resolution_width = instance.get("resolutionWidth", 1920)
|
||||||
resolution_height = instance.get("resolutionHeight", 1080)
|
resolution_height = instance.get("resolutionHeight", 1080)
|
||||||
|
|
@ -168,7 +167,6 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin):
|
||||||
slate_frame = instance.get("slateFrame")
|
slate_frame = instance.get("slateFrame")
|
||||||
version = instance.get("version")
|
version = instance.get("version")
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Search in directory
|
# Search in directory
|
||||||
data = dict()
|
data = dict()
|
||||||
|
|
@ -217,6 +215,7 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin):
|
||||||
families.append("render2d")
|
families.append("render2d")
|
||||||
if families_data and "slate" in families_data:
|
if families_data and "slate" in families_data:
|
||||||
families.append("slate")
|
families.append("slate")
|
||||||
|
families.append("slate.farm")
|
||||||
|
|
||||||
if data.get("attachTo"):
|
if data.get("attachTo"):
|
||||||
# we need to attach found collections to existing
|
# we need to attach found collections to existing
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,10 @@ class ExtractBurnin(pype.api.Extractor):
|
||||||
frame_end = int(instance.data.get("frameEnd") or 1)
|
frame_end = int(instance.data.get("frameEnd") or 1)
|
||||||
duration = frame_end - frame_start + 1
|
duration = frame_end - frame_start + 1
|
||||||
|
|
||||||
|
if "slate.farm" in instance.data["families"]:
|
||||||
|
frame_start += 1
|
||||||
|
duration -= 1
|
||||||
|
|
||||||
prep_data = {
|
prep_data = {
|
||||||
"username": instance.context.data['user'],
|
"username": instance.context.data['user'],
|
||||||
"asset": os.environ['AVALON_ASSET'],
|
"asset": os.environ['AVALON_ASSET'],
|
||||||
|
|
@ -48,22 +52,6 @@ class ExtractBurnin(pype.api.Extractor):
|
||||||
datetime_data = instance.context.data.get("datetimeData") or {}
|
datetime_data = instance.context.data.get("datetimeData") or {}
|
||||||
prep_data.update(datetime_data)
|
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
|
# Update data with template data
|
||||||
template_data = instance.data.get("assumedTemplateData") or {}
|
template_data = instance.data.get("assumedTemplateData") or {}
|
||||||
prep_data.update(template_data)
|
prep_data.update(template_data)
|
||||||
|
|
@ -111,6 +99,26 @@ class ExtractBurnin(pype.api.Extractor):
|
||||||
filled_anatomy = anatomy.format_all(_prep_data)
|
filled_anatomy = anatomy.format_all(_prep_data)
|
||||||
_prep_data["anatomy"] = filled_anatomy.get_solved()
|
_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 = {
|
burnin_data = {
|
||||||
"input": full_movie_path.replace("\\", "/"),
|
"input": full_movie_path.replace("\\", "/"),
|
||||||
"codec": repre.get("codec", []),
|
"codec": repre.get("codec", []),
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,9 @@ class CollectNukeWrites(pyblish.api.InstancePlugin):
|
||||||
handle_end = instance.context.data["handleEnd"]
|
handle_end = instance.context.data["handleEnd"]
|
||||||
first_frame = int(nuke.root()["first_frame"].getValue())
|
first_frame = int(nuke.root()["first_frame"].getValue())
|
||||||
last_frame = int(nuke.root()["last_frame"].getValue())
|
last_frame = int(nuke.root()["last_frame"].getValue())
|
||||||
|
frame_length = int(
|
||||||
|
last_frame - first_frame + 1
|
||||||
|
)
|
||||||
|
|
||||||
if node["use_limit"].getValue():
|
if node["use_limit"].getValue():
|
||||||
handles = 0
|
handles = 0
|
||||||
|
|
@ -82,8 +85,26 @@ class CollectNukeWrites(pyblish.api.InstancePlugin):
|
||||||
collected_frames = [f for f in os.listdir(output_dir)
|
collected_frames = [f for f in os.listdir(output_dir)
|
||||||
if ext in f]
|
if ext in f]
|
||||||
if collected_frames:
|
if collected_frames:
|
||||||
representation['frameStart'] = "%0{}d".format(
|
collected_frames_len = len(collected_frames)
|
||||||
|
frame_start_str = "%0{}d".format(
|
||||||
len(str(last_frame))) % first_frame
|
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):
|
||||||
|
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
|
representation['files'] = collected_frames
|
||||||
instance.data["representations"].append(representation)
|
instance.data["representations"].append(representation)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ class ExtractSlateFrame(pype.api.Extractor):
|
||||||
self.render_slate(instance)
|
self.render_slate(instance)
|
||||||
|
|
||||||
def render_slate(self, instance):
|
def render_slate(self, instance):
|
||||||
|
node_subset_name = instance.data.get("name", None)
|
||||||
node = instance[0] # group node
|
node = instance[0] # group node
|
||||||
self.log.info("Creating staging dir...")
|
self.log.info("Creating staging dir...")
|
||||||
|
|
||||||
|
|
@ -47,6 +48,10 @@ class ExtractSlateFrame(pype.api.Extractor):
|
||||||
self.log.info(
|
self.log.info(
|
||||||
"StagingDir `{0}`...".format(instance.data["stagingDir"]))
|
"StagingDir `{0}`...".format(instance.data["stagingDir"]))
|
||||||
|
|
||||||
|
frame_length = int(
|
||||||
|
instance.data["frameEnd"] - instance.data["frameStart"] + 1
|
||||||
|
)
|
||||||
|
|
||||||
temporary_nodes = []
|
temporary_nodes = []
|
||||||
collection = instance.data.get("collection", None)
|
collection = instance.data.get("collection", None)
|
||||||
|
|
||||||
|
|
@ -56,10 +61,16 @@ class ExtractSlateFrame(pype.api.Extractor):
|
||||||
"{head}{padding}{tail}"))
|
"{head}{padding}{tail}"))
|
||||||
fhead = collection.format("{head}")
|
fhead = collection.format("{head}")
|
||||||
|
|
||||||
|
collected_frames_len = int(len(collection.indexes))
|
||||||
|
|
||||||
# get first and last frame
|
# get first and last frame
|
||||||
first_frame = min(collection.indexes) - 1
|
first_frame = min(collection.indexes) - 1
|
||||||
|
self.log.info('frame_length: {}'.format(frame_length))
|
||||||
if "slate" in instance.data["families"]:
|
self.log.info(
|
||||||
|
'len(collection.indexes): {}'.format(collected_frames_len)
|
||||||
|
)
|
||||||
|
if ("slate" in instance.data["families"]) \
|
||||||
|
and (frame_length != collected_frames_len):
|
||||||
first_frame += 1
|
first_frame += 1
|
||||||
|
|
||||||
last_frame = first_frame
|
last_frame = first_frame
|
||||||
|
|
@ -103,6 +114,8 @@ class ExtractSlateFrame(pype.api.Extractor):
|
||||||
|
|
||||||
# Render frames
|
# Render frames
|
||||||
nuke.execute(write_node.name(), int(first_frame), int(last_frame))
|
nuke.execute(write_node.name(), int(first_frame), int(last_frame))
|
||||||
|
# also render slate as sequence frame
|
||||||
|
nuke.execute(node_subset_name, int(first_frame), int(last_frame))
|
||||||
|
|
||||||
self.log.debug(
|
self.log.debug(
|
||||||
"slate frame path: {}".format(instance.data["slateFrame"]))
|
"slate frame path: {}".format(instance.data["slateFrame"]))
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,8 @@ class ValidateRenderedFrames(pyblish.api.InstancePlugin):
|
||||||
'len(collection.indexes): {}'.format(collected_frames_len)
|
'len(collection.indexes): {}'.format(collected_frames_len)
|
||||||
)
|
)
|
||||||
|
|
||||||
if "slate" in instance.data["families"]:
|
if ("slate" in instance.data["families"]) \
|
||||||
|
and (frame_length != collected_frames_len):
|
||||||
collected_frames_len -= 1
|
collected_frames_len -= 1
|
||||||
|
|
||||||
assert (collected_frames_len == frame_length), (
|
assert (collected_frames_len == frame_length), (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue