mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Jakub's comment
This commit is contained in:
parent
dab513f01c
commit
be10dc7349
2 changed files with 30 additions and 6 deletions
|
|
@ -120,7 +120,9 @@ def deliver_single_file(
|
|||
anatomy_data,
|
||||
format_dict,
|
||||
report_items,
|
||||
log
|
||||
log,
|
||||
has_renumbered_frame=False,
|
||||
new_frame_start=0
|
||||
):
|
||||
"""Copy single file to calculated path based on template
|
||||
|
||||
|
|
|
|||
|
|
@ -237,13 +237,35 @@ class DeliveryOptionsDialog(QtWidgets.QDialog):
|
|||
src_paths.append(src_path)
|
||||
sources_and_frames = collect_frames(src_paths)
|
||||
|
||||
frames = set(sources_and_frames.values())
|
||||
frames.discard(None)
|
||||
first_frame = None
|
||||
if frames:
|
||||
first_frame = next(iter(frames))
|
||||
|
||||
|
||||
for src_path, frame in sources_and_frames.items():
|
||||
args[0] = src_path
|
||||
if frame:
|
||||
anatomy_data["frame"] = frame
|
||||
new_report_items, uploaded = deliver_sequence(*args)
|
||||
else:
|
||||
new_report_items, uploaded = deliver_single_file(*args)
|
||||
# Renumber frames
|
||||
if renumber_frame and frame is not None:
|
||||
# Calculate offset between first frame and current frame
|
||||
# - '0' for first frame
|
||||
offset = frame_offset - int(first_frame)
|
||||
# Add offset to new frame start
|
||||
frame = int(frame)
|
||||
dst_frame = frame + offset
|
||||
if dst_frame < 0:
|
||||
msg = "Renumber frame has a smaller number than original frame" # noqa
|
||||
report_items[msg].append(src_path)
|
||||
self.log.warning("{} <{}>".format(
|
||||
msg, dst_frame))
|
||||
continue
|
||||
frame = dst_frame
|
||||
|
||||
if frame is not None:
|
||||
if frame:
|
||||
anatomy_data["frame"] = frame
|
||||
new_report_items, uploaded = deliver_single_file(*args)
|
||||
report_items.update(new_report_items)
|
||||
self._update_progress(uploaded)
|
||||
else: # fallback for Pype2 and representations without files
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue