mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
fix(nks): plate single file vs sequence treatment
This commit is contained in:
parent
695351cefc
commit
c6c4c26a54
1 changed files with 12 additions and 19 deletions
|
|
@ -147,22 +147,15 @@ class CollectPlatesData(api.InstancePlugin):
|
||||||
"version": version
|
"version": version
|
||||||
})
|
})
|
||||||
|
|
||||||
|
source_first_frame = instance.data.get("sourceFirst")
|
||||||
|
source_file_head = instance.data.get("sourceFileHead")
|
||||||
|
|
||||||
try:
|
if instance.data.get("isSequence", False):
|
||||||
basename, ext = os.path.splitext(source_file)
|
self.log.info("Is sequence of files")
|
||||||
head, padding = os.path.splitext(basename)
|
file = os.path.basename(source_file)
|
||||||
ext = ext[1:]
|
ext = os.path.splitext(file)[-1][1:]
|
||||||
padding = padding[1:]
|
self.log.debug("source_file_head: `{}`".format(source_file_head))
|
||||||
self.log.debug("_ padding: `{}`".format(padding))
|
head = source_file_head[:-1]
|
||||||
# head, padding, ext = source_file.split('.')
|
|
||||||
source_first_frame = int(padding)
|
|
||||||
padding = len(padding)
|
|
||||||
file = "{head}.%0{padding}d.{ext}".format(
|
|
||||||
head=head,
|
|
||||||
padding=padding,
|
|
||||||
ext=ext
|
|
||||||
)
|
|
||||||
|
|
||||||
start_frame = int(source_first_frame + instance.data["sourceInH"])
|
start_frame = int(source_first_frame + instance.data["sourceInH"])
|
||||||
duration = int(
|
duration = int(
|
||||||
instance.data["sourceOutH"] - instance.data["sourceInH"])
|
instance.data["sourceOutH"] - instance.data["sourceInH"])
|
||||||
|
|
@ -170,10 +163,10 @@ class CollectPlatesData(api.InstancePlugin):
|
||||||
self.log.debug("start_frame: `{}`".format(start_frame))
|
self.log.debug("start_frame: `{}`".format(start_frame))
|
||||||
self.log.debug("end_frame: `{}`".format(end_frame))
|
self.log.debug("end_frame: `{}`".format(end_frame))
|
||||||
files = [file % i for i in range(start_frame, (end_frame + 1), 1)]
|
files = [file % i for i in range(start_frame, (end_frame + 1), 1)]
|
||||||
except Exception as e:
|
else:
|
||||||
self.log.warning("Exception in file: {}".format(e))
|
self.log.info("Is single file")
|
||||||
head, ext = os.path.splitext(source_file)
|
ext = os.path.splitext(source_file)[-1][1:]
|
||||||
ext = ext[1:]
|
head = source_file_head
|
||||||
files = source_file
|
files = source_file
|
||||||
start_frame = instance.data["sourceInH"]
|
start_frame = instance.data["sourceInH"]
|
||||||
end_frame = instance.data["sourceOutH"]
|
end_frame = instance.data["sourceOutH"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue