add title replacement
This commit is contained in:
parent
208b13cbe6
commit
efd5e61a2e
1 changed files with 17 additions and 11 deletions
|
@ -12,24 +12,27 @@ import os
|
||||||
import platform
|
import platform
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
|
|
||||||
titlemap = {
|
titlemap = (
|
||||||
'id': "11404", 'title': "Attacking CPUs with Power Side Channels from Software",
|
{'id': "000000", 'title': "Short title goes here"},
|
||||||
'id': "205", 'title': "Attacking CPUs with Power Side Channels from Software",
|
)
|
||||||
}
|
|
||||||
|
|
||||||
# Parse arguments
|
# Parse arguments
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description='C3VOC Intro-Outro-Generator - Variant to use with Adobe After Effects Files',
|
description='C3VOC Intro-Outro-Generator - Variant to use with Adobe After Effects Files',
|
||||||
usage="./make-adobe-after-effects.py yourproject/ https://url/to/schedule.xml",
|
usage="./make-adobe-after-effects.py yourproject/ https://url/to/schedule.xml filename_of_intro.aepx",
|
||||||
formatter_class=argparse.RawTextHelpFormatter)
|
formatter_class=argparse.RawTextHelpFormatter)
|
||||||
|
|
||||||
parser.add_argument('project', action="store", metavar='Project folder', type=str, help='''
|
parser.add_argument('project', action="store", metavar='Project folder', type=str, help='''
|
||||||
Path to your project folder with After Effects Files (intro.aepx)
|
Path to your project folder with After Effects Files
|
||||||
''')
|
''')
|
||||||
parser.add_argument('schedule', action="store", metavar='Schedule-URL', type=str, nargs='?', help='''
|
parser.add_argument('schedule', action="store", metavar='Schedule-URL', type=str, nargs='?', help='''
|
||||||
URL or Path to your schedule.xml
|
URL or Path to your schedule.xml
|
||||||
''')
|
''')
|
||||||
|
|
||||||
|
parser.add_argument('introfile', action="store", metavar='Name of intro source file', default='intro.aepx', type=str, nargs='?', help='''
|
||||||
|
Filename of the intro source file inside the project folder
|
||||||
|
''')
|
||||||
|
|
||||||
parser.add_argument('--debug', action="store_true", default=False, help='''
|
parser.add_argument('--debug', action="store_true", default=False, help='''
|
||||||
Run script in debug mode and render with placeholder texts,
|
Run script in debug mode and render with placeholder texts,
|
||||||
not parsing or accessing a schedule. Schedule-URL can be left blank when
|
not parsing or accessing a schedule. Schedule-URL can be left blank when
|
||||||
|
@ -224,7 +227,7 @@ def enqueue_job(event):
|
||||||
with open(script_doc, 'w', encoding='utf-8') as fp:
|
with open(script_doc, 'w', encoding='utf-8') as fp:
|
||||||
fp.write(scriptstr)
|
fp.write(scriptstr)
|
||||||
|
|
||||||
copyfile(args.project+'intro.aepx',work_doc)
|
copyfile(args.project+args.introfile,work_doc)
|
||||||
|
|
||||||
if platform.system() == 'Darwin':
|
if platform.system() == 'Darwin':
|
||||||
copyfile(args.project+'intro.scpt',ascript_doc)
|
copyfile(args.project+'intro.scpt',ascript_doc)
|
||||||
|
@ -241,7 +244,7 @@ def enqueue_job(event):
|
||||||
run_once(r'C:/Program\ Files/Adobe/Adobe\ After\ Effects\ 2022/Support\ Files/AfterFX.exe -noui -r {scriptpath}',
|
run_once(r'C:/Program\ Files/Adobe/Adobe\ After\ Effects\ 2022/Support\ Files/AfterFX.exe -noui -r {scriptpath}',
|
||||||
scriptpath=script_doc)
|
scriptpath=script_doc)
|
||||||
|
|
||||||
time.sleep(2)
|
time.sleep(5)
|
||||||
|
|
||||||
run(r'C:/Program\ Files/Adobe/Adobe\ After\ Effects\ 2022/Support\ Files/aerender.exe -project {jobpath} -comp "intro" -mfr on 100 -output {locationpath}',
|
run(r'C:/Program\ Files/Adobe/Adobe\ After\ Effects\ 2022/Support\ Files/aerender.exe -project {jobpath} -comp "intro" -mfr on 100 -output {locationpath}',
|
||||||
jobpath=work_doc,
|
jobpath=work_doc,
|
||||||
|
@ -321,10 +324,13 @@ for event in events:
|
||||||
print("skipping day %s (%s)" % (event['day'], event['title']))
|
print("skipping day %s (%s)" % (event['day'], event['title']))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if str(event['id']) in str(titlemap['id']):
|
for item in titlemap:
|
||||||
|
if str(item['id']) == str(event['id']):
|
||||||
|
title = item['title']
|
||||||
event_print(event, "titlemap replacement")
|
event_print(event, "titlemap replacement")
|
||||||
event['title'] = titlemap['title']
|
event_print(event, "replacing title %s with %s" % (event['title'], title))
|
||||||
|
event['title'] = title
|
||||||
|
|
||||||
event_print(event, "enqueued as " + str(event['id']))
|
event_print(event, "enqueued as " + str(event['id']))
|
||||||
|
|
||||||
job_id = enqueue_job(event)
|
job_id = enqueue_job(event)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue