mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
Merge pull request #3555 from pypeclub/bugfix/OP-3556_Nuke-Farm-slate-existing-frames-frame-shorter
Nuke: publish existing frames with slate with correct range
This commit is contained in:
commit
bc24787a5f
7 changed files with 27 additions and 25 deletions
|
|
@ -181,8 +181,6 @@ class ExporterReview(object):
|
||||||
# get first and last frame
|
# get first and last frame
|
||||||
self.first_frame = min(self.collection.indexes)
|
self.first_frame = min(self.collection.indexes)
|
||||||
self.last_frame = max(self.collection.indexes)
|
self.last_frame = max(self.collection.indexes)
|
||||||
if "slate" in self.instance.data["families"]:
|
|
||||||
self.first_frame += 1
|
|
||||||
else:
|
else:
|
||||||
self.fname = os.path.basename(self.path_in)
|
self.fname = os.path.basename(self.path_in)
|
||||||
self.fhead = os.path.splitext(self.fname)[0] + "."
|
self.fhead = os.path.splitext(self.fname)[0] + "."
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ class CollectSlate(pyblish.api.InstancePlugin):
|
||||||
|
|
||||||
if slate_node:
|
if slate_node:
|
||||||
instance.data["slateNode"] = slate_node
|
instance.data["slateNode"] = slate_node
|
||||||
|
instance.data["slate"] = True
|
||||||
instance.data["families"].append("slate")
|
instance.data["families"].append("slate")
|
||||||
instance.data["versionData"]["families"].append("slate")
|
instance.data["versionData"]["families"].append("slate")
|
||||||
self.log.info(
|
self.log.info(
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,6 @@ class NukeRenderLocal(openpype.api.Extractor):
|
||||||
|
|
||||||
first_frame = instance.data.get("frameStartHandle", None)
|
first_frame = instance.data.get("frameStartHandle", None)
|
||||||
|
|
||||||
# exception for slate workflow
|
|
||||||
if "slate" in families:
|
|
||||||
first_frame -= 1
|
|
||||||
|
|
||||||
last_frame = instance.data.get("frameEndHandle", None)
|
last_frame = instance.data.get("frameEndHandle", None)
|
||||||
node_subset_name = instance.data.get("name", None)
|
node_subset_name = instance.data.get("name", None)
|
||||||
|
|
||||||
|
|
@ -68,10 +64,6 @@ class NukeRenderLocal(openpype.api.Extractor):
|
||||||
int(last_frame)
|
int(last_frame)
|
||||||
)
|
)
|
||||||
|
|
||||||
# exception for slate workflow
|
|
||||||
if "slate" in families:
|
|
||||||
first_frame += 1
|
|
||||||
|
|
||||||
ext = node["file_type"].value()
|
ext = node["file_type"].value()
|
||||||
|
|
||||||
if "representations" not in instance.data:
|
if "representations" not in instance.data:
|
||||||
|
|
@ -88,8 +80,11 @@ class NukeRenderLocal(openpype.api.Extractor):
|
||||||
repre = {
|
repre = {
|
||||||
'name': ext,
|
'name': ext,
|
||||||
'ext': ext,
|
'ext': ext,
|
||||||
'frameStart': "%0{}d".format(
|
'frameStart': (
|
||||||
len(str(last_frame))) % first_frame,
|
"{{:0>{}}}"
|
||||||
|
.format(len(str(last_frame)))
|
||||||
|
.format(first_frame)
|
||||||
|
),
|
||||||
'files': filenames,
|
'files': filenames,
|
||||||
"stagingDir": out_dir
|
"stagingDir": out_dir
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ from openpype.hosts.nuke.api import (
|
||||||
get_view_process_node
|
get_view_process_node
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class ExtractSlateFrame(openpype.api.Extractor):
|
class ExtractSlateFrame(openpype.api.Extractor):
|
||||||
"""Extracts movie and thumbnail with baked in luts
|
"""Extracts movie and thumbnail with baked in luts
|
||||||
|
|
||||||
|
|
@ -236,6 +237,7 @@ class ExtractSlateFrame(openpype.api.Extractor):
|
||||||
def _render_slate_to_sequence(self, instance):
|
def _render_slate_to_sequence(self, instance):
|
||||||
# set slate frame
|
# set slate frame
|
||||||
first_frame = instance.data["frameStartHandle"]
|
first_frame = instance.data["frameStartHandle"]
|
||||||
|
last_frame = instance.data["frameEndHandle"]
|
||||||
slate_first_frame = first_frame - 1
|
slate_first_frame = first_frame - 1
|
||||||
|
|
||||||
# render slate as sequence frame
|
# render slate as sequence frame
|
||||||
|
|
@ -284,6 +286,13 @@ class ExtractSlateFrame(openpype.api.Extractor):
|
||||||
matching_repre["files"] = [first_filename, slate_filename]
|
matching_repre["files"] = [first_filename, slate_filename]
|
||||||
elif slate_filename not in matching_repre["files"]:
|
elif slate_filename not in matching_repre["files"]:
|
||||||
matching_repre["files"].insert(0, slate_filename)
|
matching_repre["files"].insert(0, slate_filename)
|
||||||
|
matching_repre["frameStart"] = (
|
||||||
|
"{{:0>{}}}"
|
||||||
|
.format(len(str(last_frame)))
|
||||||
|
.format(slate_first_frame)
|
||||||
|
)
|
||||||
|
self.log.debug(
|
||||||
|
"__ matching_repre: {}".format(pformat(matching_repre)))
|
||||||
|
|
||||||
self.log.warning("Added slate frame to representation files")
|
self.log.warning("Added slate frame to representation files")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ class ValidateRenderedFrames(pyblish.api.InstancePlugin):
|
||||||
self.log.error(msg)
|
self.log.error(msg)
|
||||||
raise ValidationException(msg)
|
raise ValidationException(msg)
|
||||||
|
|
||||||
collected_frames_len = int(len(collection.indexes))
|
collected_frames_len = len(collection.indexes)
|
||||||
coll_start = min(collection.indexes)
|
coll_start = min(collection.indexes)
|
||||||
coll_end = max(collection.indexes)
|
coll_end = max(collection.indexes)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,10 +80,6 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin):
|
||||||
"Using published scene for render {}".format(script_path)
|
"Using published scene for render {}".format(script_path)
|
||||||
)
|
)
|
||||||
|
|
||||||
# exception for slate workflow
|
|
||||||
if "slate" in instance.data["families"]:
|
|
||||||
submit_frame_start -= 1
|
|
||||||
|
|
||||||
response = self.payload_submit(
|
response = self.payload_submit(
|
||||||
instance,
|
instance,
|
||||||
script_path,
|
script_path,
|
||||||
|
|
@ -99,10 +95,6 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin):
|
||||||
instance.data["publishJobState"] = "Suspended"
|
instance.data["publishJobState"] = "Suspended"
|
||||||
|
|
||||||
if instance.data.get("bakingNukeScripts"):
|
if instance.data.get("bakingNukeScripts"):
|
||||||
# exception for slate workflow
|
|
||||||
if "slate" in instance.data["families"]:
|
|
||||||
submit_frame_start += 1
|
|
||||||
|
|
||||||
for baking_script in instance.data["bakingNukeScripts"]:
|
for baking_script in instance.data["bakingNukeScripts"]:
|
||||||
render_path = baking_script["bakeRenderPath"]
|
render_path = baking_script["bakeRenderPath"]
|
||||||
script_path = baking_script["bakeScriptPath"]
|
script_path = baking_script["bakeScriptPath"]
|
||||||
|
|
@ -365,7 +357,7 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin):
|
||||||
if not instance.data.get("expectedFiles"):
|
if not instance.data.get("expectedFiles"):
|
||||||
instance.data["expectedFiles"] = []
|
instance.data["expectedFiles"] = []
|
||||||
|
|
||||||
dir = os.path.dirname(path)
|
dirname = os.path.dirname(path)
|
||||||
file = os.path.basename(path)
|
file = os.path.basename(path)
|
||||||
|
|
||||||
if "#" in file:
|
if "#" in file:
|
||||||
|
|
@ -377,9 +369,12 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin):
|
||||||
instance.data["expectedFiles"].append(path)
|
instance.data["expectedFiles"].append(path)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if instance.data.get("slate"):
|
||||||
|
start_frame -= 1
|
||||||
|
|
||||||
for i in range(start_frame, (end_frame + 1)):
|
for i in range(start_frame, (end_frame + 1)):
|
||||||
instance.data["expectedFiles"].append(
|
instance.data["expectedFiles"].append(
|
||||||
os.path.join(dir, (file % i)).replace("\\", "/"))
|
os.path.join(dirname, (file % i)).replace("\\", "/"))
|
||||||
|
|
||||||
def get_limit_groups(self):
|
def get_limit_groups(self):
|
||||||
"""Search for limit group nodes and return group name.
|
"""Search for limit group nodes and return group name.
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
|
||||||
# mapping of instance properties to be transfered to new instance for every
|
# mapping of instance properties to be transfered to new instance for every
|
||||||
# specified family
|
# specified family
|
||||||
instance_transfer = {
|
instance_transfer = {
|
||||||
"slate": ["slateFrames"],
|
"slate": ["slateFrames", "slate"],
|
||||||
"review": ["lutPath"],
|
"review": ["lutPath"],
|
||||||
"render2d": ["bakingNukeScripts", "version"],
|
"render2d": ["bakingNukeScripts", "version"],
|
||||||
"renderlayer": ["convertToScanline"]
|
"renderlayer": ["convertToScanline"]
|
||||||
|
|
@ -585,11 +585,15 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
|
||||||
" This may cause issues on farm."
|
" This may cause issues on farm."
|
||||||
).format(staging))
|
).format(staging))
|
||||||
|
|
||||||
|
frame_start = int(instance.get("frameStartHandle"))
|
||||||
|
if instance.get("slate"):
|
||||||
|
frame_start -= 1
|
||||||
|
|
||||||
rep = {
|
rep = {
|
||||||
"name": ext,
|
"name": ext,
|
||||||
"ext": ext,
|
"ext": ext,
|
||||||
"files": [os.path.basename(f) for f in list(collection)],
|
"files": [os.path.basename(f) for f in list(collection)],
|
||||||
"frameStart": int(instance.get("frameStartHandle")),
|
"frameStart": frame_start,
|
||||||
"frameEnd": int(instance.get("frameEndHandle")),
|
"frameEnd": int(instance.get("frameEndHandle")),
|
||||||
# If expectedFile are absolute, we need only filenames
|
# If expectedFile are absolute, we need only filenames
|
||||||
"stagingDir": staging,
|
"stagingDir": staging,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue