mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
feat(nk): dealing with slate if render family in write collector
This commit is contained in:
parent
c4f049f64e
commit
cc1c176ef0
1 changed files with 14 additions and 2 deletions
|
|
@ -41,7 +41,10 @@ class CollectNukeWrites(pyblish.api.InstancePlugin):
|
|||
handle_end = instance.context.data["handleEnd"]
|
||||
first_frame = int(nuke.root()["first_frame"].getValue())
|
||||
last_frame = int(nuke.root()["last_frame"].getValue())
|
||||
|
||||
frame_length = int(
|
||||
last_frame - first_frame + 1
|
||||
)
|
||||
|
||||
if node["use_limit"].getValue():
|
||||
handles = 0
|
||||
first_frame = int(node["first"].getValue())
|
||||
|
|
@ -82,8 +85,17 @@ class CollectNukeWrites(pyblish.api.InstancePlugin):
|
|||
collected_frames = [f for f in os.listdir(output_dir)
|
||||
if ext in f]
|
||||
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
|
||||
representation['frameStart'] = frame_start_str
|
||||
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
|
||||
instance.data["representations"].append(representation)
|
||||
except Exception:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue