mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
Fix support for published files without frame numbers in name
This commit is contained in:
parent
29f68f366b
commit
b1850aac03
1 changed files with 16 additions and 2 deletions
|
|
@ -54,8 +54,21 @@ class AssLoader(api.Loader):
|
||||||
collections, remainder = clique.assemble(frames,
|
collections, remainder = clique.assemble(frames,
|
||||||
minimum_items=1,
|
minimum_items=1,
|
||||||
patterns=patterns)
|
patterns=patterns)
|
||||||
assert len(collections) == 1
|
self.log.debug("Detected collections: {}".format(collections))
|
||||||
assert not remainder
|
self.log.debug("Detected remainder: {}".format(remainder))
|
||||||
|
|
||||||
|
if not collections and remainder:
|
||||||
|
if len(remainder) != 1:
|
||||||
|
raise ValueError("Frames not correctly detected "
|
||||||
|
"in: {}".format(remainder))
|
||||||
|
|
||||||
|
# A single frame without frame range detected
|
||||||
|
filepath = remainder[0]
|
||||||
|
return os.path.normpath(filepath).replace("\\", "/")
|
||||||
|
|
||||||
|
# Frames detected with a valid "frame" number pattern
|
||||||
|
# Then we don't want to have any remainder files found
|
||||||
|
assert len(collections) == 1 and not remainder
|
||||||
collection = collections[0]
|
collection = collections[0]
|
||||||
|
|
||||||
num_frames = len(collection.indexes)
|
num_frames = len(collection.indexes)
|
||||||
|
|
@ -63,6 +76,7 @@ class AssLoader(api.Loader):
|
||||||
# Return the input path without dynamic $F variable
|
# Return the input path without dynamic $F variable
|
||||||
result = path
|
result = path
|
||||||
else:
|
else:
|
||||||
|
# More than a single frame detected - use $F{padding}
|
||||||
fname = "{}$F{}{}".format(collection.head,
|
fname = "{}$F{}{}".format(collection.head,
|
||||||
collection.padding,
|
collection.padding,
|
||||||
collection.tail)
|
collection.tail)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue