mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
removed frames regex (not used)
This commit is contained in:
parent
d72e6ccd89
commit
d19023f3b2
1 changed files with 0 additions and 33 deletions
|
|
@ -184,7 +184,6 @@ class DJVViewAction(BaseHandler):
|
|||
# Launching application
|
||||
if "values" in event["data"]:
|
||||
filename = event['data']['values']['path']
|
||||
file_type = filename.split(".")[-1]
|
||||
|
||||
# TODO Is this proper way?
|
||||
try:
|
||||
|
|
@ -192,38 +191,6 @@ class DJVViewAction(BaseHandler):
|
|||
except Exception:
|
||||
fps = 24
|
||||
|
||||
# TODO issequence is probably already built-in validation in ftrack
|
||||
isseq = re.findall('%[0-9]*d', filename)
|
||||
if len(isseq) > 0:
|
||||
if len(isseq) == 1:
|
||||
frames = []
|
||||
padding = re.findall('%[0-9]*d', filename).pop()
|
||||
index = filename.find(padding)
|
||||
|
||||
full_file = filename[0:index-1]
|
||||
file = full_file.split(os.sep)[-1]
|
||||
folder = os.path.dirname(full_file)
|
||||
|
||||
for fname in os.listdir(path=folder):
|
||||
if fname.endswith(file_type) and file in fname:
|
||||
frames.append(int(fname.split(".")[-2]))
|
||||
|
||||
if len(frames) > 0:
|
||||
start = min(frames)
|
||||
end = max(frames)
|
||||
|
||||
range = (padding % start) + '-' + (padding % end)
|
||||
filename = re.sub('%[0-9]*d', range, filename)
|
||||
else:
|
||||
msg = (
|
||||
'DJV View - Filename has more than one'
|
||||
' sequence identifier.'
|
||||
)
|
||||
return {
|
||||
'success': False,
|
||||
'message': (msg)
|
||||
}
|
||||
|
||||
cmd = []
|
||||
# DJV path
|
||||
cmd.append(os.path.normpath(self.djv_path))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue