Compare commits

...
2 Commits
Author SHA1 Message Date
florentin.luce e50a7aee31 fix shot_template 2024-04-19 12:18:56 +02:00
florentin.luce 948f5b53dd fix stamps 2024-04-18 18:02:38 +02:00
2 changed files with 7 additions and 8 deletions
+6 -7
View File
@@ -147,20 +147,19 @@ def open_file(filepath, env=None, select=False):
subprocess.Popen(cmd, env=env)
# def parse(string, template):
# template = re.sub(r'{index:(.+?)}', r'(?P<index>.+)', template)
# reg = re.sub(r'{(.+?)}', r'(?P<_\1>.+)', template)
"""def parse(template, string):
template = re.sub(r'{index:(.+?)}', r'(?P<index>.+)', template)
reg = re.sub(r'{(.+?)}', r'(?P<_\1>.+)', template)
# values = list(re.search(reg, string).groups())
# keys = re.findall(r'{(.+?)}', template) + ['index']
values = list(re.search(reg, string).groups())
keys = re.findall(r'{(.+?)}', template) + ['index']
# return dict(zip(keys, values))
return dict(zip(keys, values))"""
def parse(template, string):
reg = re.sub(r'{[^}]*}|\.', lambda m: m.group() if m.group().startswith('{') else r'\.', template)
reg = re.sub(r'{(.+?)}', r'(?P<\1>.*)', reg)
#print(string, template, reg)
if result := re.match(reg, string):
return result.groupdict()
+1 -1
View File
@@ -218,7 +218,7 @@ class VSETB_OT_set_stamps(Operator):
# Shot Name
shot_strip_stamp = new_text_strip('shot_stamp', channel=2, **stamp_params,
text='sq{sequence} / sh{shot}', align_y='BOTTOM')
text='{sequence} / sh{shot}', align_y='BOTTOM')
shot_strip_stamp.crop.min_x = crop_x
shot_strip_stamp.crop.max_x = crop_x