fix(nks): plate single file vs sequence treatment

This commit is contained in:
Jakub Jezek 2020-03-24 18:27:45 +01:00
parent 695351cefc
commit c6c4c26a54
No known key found for this signature in database
GPG key ID: C4B96E101D2A47F3

View file

@ -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"]