Skip to content

Commit

Permalink
Merge pull request #906 from BigRoy/bugfix/AY-6775_deliver_versions_udim
Browse files Browse the repository at this point in the history
Fix delivering UDIMs using {udim} in delivery template
  • Loading branch information
BigRoy authored Sep 30, 2024
2 parents 28d30bc + 89a4d50 commit 53ffc37
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
5 changes: 4 additions & 1 deletion client/ayon_core/lib/path_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ def collect_frames(files):
dict: {'/folder/product_v001.0001.png': '0001', ....}
"""

patterns = [clique.PATTERNS["frames"]]
# clique.PATTERNS["frames"] supports only `.1001.exr` not `_1001.exr` so
# we use a customized pattern.
pattern = "[_.](?P<index>(?P<padding>0*)\\d+)\\.\\D+\\d?$"
patterns = [pattern]
collections, remainder = clique.assemble(
files, minimum_items=1, patterns=patterns)

Expand Down
18 changes: 17 additions & 1 deletion client/ayon_core/plugins/load/delivery.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ def deliver(self):
self.log
]

# TODO: This will currently incorrectly detect 'resources'
# that are published along with the publish, because those should
# not adhere to the template directly but are ingested in a
# customized way. For example, maya look textures or any publish
# that directly adds files into `instance.data["transfers"]`
src_paths = []
for repre_file in repre["files"]:
src_path = self.anatomy.fill_root(repre_file["path"])
Expand Down Expand Up @@ -261,7 +266,18 @@ def deliver(self):
frame = dst_frame

if frame is not None:
anatomy_data["frame"] = frame
if repre["context"].get("frame"):
anatomy_data["frame"] = frame
elif repre["context"].get("udim"):
anatomy_data["udim"] = frame
else:
# Fallback
self.log.warning(
"Representation context has no frame or udim"
" data. Supplying sequence frame to '{frame}'"
" formatting data."
)
anatomy_data["frame"] = frame
new_report_items, uploaded = deliver_single_file(*args)
report_items.update(new_report_items)
self._update_progress(uploaded)
Expand Down

0 comments on commit 53ffc37

Please sign in to comment.