This commit is contained in:
Christian Dieckhoff 2024-12-08 14:22:44 +01:00 committed by GitHub
commit 838ca52823
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 59798 additions and 45 deletions

View file

@ -8,12 +8,12 @@ Yes! That's what I want!
------------------------ ------------------------
Okay, let's go. Okay, let's go.
- Install Adobe After Effects CC 2018 - Install Adobe After Effects 2025
- Install python3, python3-lxml, python3-cssutils (or use virtualenv, see below), inkscape and libav-tools - Install python3, python3-lxml, python3-cssutils (or use virtualenv, see below), inkscape and libav-tools
- Fork this repo on github and clone your personal fork to your local system. - Fork this repo on github and clone your personal fork to your local system.
- Copy one of the existing setup: voc_ae - Copy one of the existing setup: voc_ae
- Open `intro.aep` and modify it. You can also create a new project. For the VOC-Setup you should use a Pixel-Resolution of `1920×1080` (or for the legacy SD/.dv-Pipeline `1024×576`). - Open `intro.aepx` and modify it. You can also create a new project. For the VOC-Setup you should use a Pixel-Resolution of `1920×1080` (or for the legacy SD/.dv-Pipeline `1024×576`).
- If you create a new project, name it `intro.aep` and also copy `intro.jsx` and `intro.scpt` into the same folder. - If you create a new project, name it `intro.aepx` and also copy `intro.jsx` into the same folder.
- Create a new composition and name it `intro`. - Create a new composition and name it `intro`.
- Use Paragraph Text Layers. This way the text will automatically wrap inside the specified area if it gets too long. - Use Paragraph Text Layers. This way the text will automatically wrap inside the specified area if it gets too long.
- Type Placeholder-Texts where the script should substitute content from your schedule.xml. By default the following placeholders are substituted - Type Placeholder-Texts where the script should substitute content from your schedule.xml. By default the following placeholders are substituted
@ -31,14 +31,14 @@ Okay, let's go.
- The template included with this repo only replaces `intro_title` and `intro_personnames` - The template included with this repo only replaces `intro_title` and `intro_personnames`
- Just copy/paste the 2x blocks required, and change the variables, to also use it for the other placeholders. - Just copy/paste the 2x blocks required, and change the variables, to also use it for the other placeholders.
- Run `./make-adobe-after-effects.py yourproject/ --debug` to generate your first intro - Run `./make-adobe-after-effects.py yourproject/ --debug` to generate your first intro
- if everything look like you'd want them to, run `./make-adobe-after-effects.py yourproject/ `. - if everything look like you'd want them to, run `./make-adobe-after-effects.py yourproject/ {schedule} `.
#### Python3 virtualenv #### Python3 virtualenv
Create virtualenv and fetch python deps: Create virtualenv and fetch python deps:
``` ```
$ virtualenv -p python3 env $ python3 -m venv env
$ . ./env/bin/activate $ . ./env/bin/activate
$ pip3 install -r requirements.txt $ pip3 install -r requirements.txt
``` ```
@ -65,7 +65,7 @@ C3VOC Intro-Outro-Generator - Variant to use with Adobe After Effects Files
positional arguments: positional arguments:
Project folder Project folder
Path to your project folder with After Effects Files (intro.aep/scpt/jsx) Path to your project folder with After Effects Files (intro.aepx/jsx)
Schedule-URL Schedule-URL
URL or Path to your schedule.xml URL or Path to your schedule.xml
@ -88,13 +88,13 @@ optional arguments:
How does it work How does it work
-------------------- --------------------
There are 3x files required to make the render work `intro.aep`, `intro.jsx` and `intro.scpt`. There are two files required to make the render work `intro.aepx`, `intro.jsx`.
`make-adobe-after-effects.py` will run the `intro.scpt` script with `intro.aep` and `intro.jsx` as arguments. `make-adobe-after-effects.py` will run `intro.aepx` with `intro.jsx` as argument.
Once done, the project file will be passed to aerender to create an intermediate <id>.mov file. Once done, the project file will be passed to aerender to create an intermediate <id>.mov file. Make sure you set .mov as a default in After Effects.
Final step is to convert the <id>.mov to <id>.ts Final step is to convert the <id>.mov to <id>.ts
Here are some details about the files and what they are for. Here are some details about the files and what they are for.
### intro.aep ### intro.aepx
This is the After Effects project file. It has to have the following items included: This is the After Effects project file. It has to have the following items included:
- Composition named `intro` - Composition named `intro`
- Paragraph text layers named `intro_<placeholder>` for each of the supported placeholder - Paragraph text layers named `intro_<placeholder>` for each of the supported placeholder
@ -103,8 +103,14 @@ This is the After Effects project file. It has to have the following items inclu
This is an After Effects Script file doing the text replacement of the placeholder texts. This is an After Effects Script file doing the text replacement of the placeholder texts.
```` ````
var comp = app.project.item(2); app.open(new File("$filename"));
var comp;
for (var i = 1; i <= app.project.numItems; i ++) {
if ((app.project.item(i) instanceof CompItem) && (app.project.item(i).name === 'intro')) {
comp = app.project.item(i);
break;
}
}
var layer_title = comp.layer('intro_title'); var layer_title = comp.layer('intro_title');
var textProp_title = layer_title.property("Source Text"); var textProp_title = layer_title.property("Source Text");
var textDocument_title = textProp_title.value; var textDocument_title = textProp_title.value;
@ -119,7 +125,7 @@ textProp_title.setValue(textDocument_title);
textDocument_persons.text = "$personnames"; textDocument_persons.text = "$personnames";
textProp_persons.setValue(textDocument_persons); textProp_persons.setValue(textDocument_persons);
app.project.save(); app.project.close(CloseOptions.SAVE_CHANGES);
```` ````
To add an additional block to replace another placeholder, copy the following: To add an additional block to replace another placeholder, copy the following:
@ -134,21 +140,6 @@ textProp_<placeholder>.setValue(textDocument_<placeholder>);
Make sure that the correct layer has been added to the AE project file, otherwise the script will fail. Make sure that the correct layer has been added to the AE project file, otherwise the script will fail.
### intro.scpt
This is an Apple Script which will open AE with the project file, and run the AE script.
````
on run argv
set aefile to (POSIX file (item 1 of argv))
set aescript to (POSIX file (item 2 of argv))
tell application "Adobe After Effects CC 2018"
open aefile
DoScriptFile aescript
quit
end tell
end run
````
It works! It doesn't work! It works! It doesn't work!
-------------------------- --------------------------
If it works, push your code to github. This way everybody can see which beautiful animations you created and we can all learn from each other. If it works, push your code to github. This way everybody can see which beautiful animations you created and we can all learn from each other.

BIN
denog16/assets/denog16.wav Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

25285
denog16/intro.aepx Normal file

File diff suppressed because one or more lines are too long

23
denog16/intro.jsx Normal file
View file

@ -0,0 +1,23 @@
app.open(new File("$filename"));
var comp;
for (var i = 1; i <= app.project.numItems; i ++) {
if ((app.project.item(i) instanceof CompItem) && (app.project.item(i).name === 'intro')) {
comp = app.project.item(i);
break;
}
}
var layer_title = comp.layer('intro_title');
var textProp_title = layer_title.property("Source Text");
var textDocument_title = textProp_title.value;
var layer_persons = comp.layer('intro_personnames');
var textProp_persons = layer_persons.property("Source Text");
var textDocument_persons = textProp_persons.value;
textDocument_title.text = "$title";
textProp_title.setValue(textDocument_title);
textDocument_persons.text = "$personnames";
textProp_persons.setValue(textDocument_persons);
app.project.close(CloseOptions.SAVE_CHANGES);

25301
denog16/outro.aepx Normal file

File diff suppressed because one or more lines are too long

1167
denog16/schedule.xml Normal file

File diff suppressed because it is too large Load diff

View file

@ -199,19 +199,18 @@ def enqueue_job(event):
return return
work_doc = os.path.join(tempdir.name, event_id + '.aepx') work_doc = os.path.join(tempdir.name, event_id + '.aepx')
script_doc = os.path.join(tempdir.name, event_id+'.jsx') script_doc = os.path.join(tempdir.name, event_id+'.jsx')
ascript_doc = os.path.join(tempdir.name, event_id+'.scpt')
intermediate_clip = os.path.join(tempdir.name, event_id + '.mov') intermediate_clip = os.path.join(tempdir.name, event_id + '.mov')
if event_id == 'pause' or event_id == 'outro' or event_id == 'bgloop': if event_id == 'pause' or event_id == 'outro' or event_id == 'bgloop':
copyfile(args.project + event_id + '.aepx', work_doc) copyfile(args.project + event_id + '.aepx', work_doc)
if platform.system() == 'Darwin': if platform.system() == 'Darwin':
run(r'/Applications/Adobe\ After\ Effects\ 2024/aerender -project {jobpath} -comp {comp} -mp -output {locationpath}', run(r'/Applications/Adobe\ After\ Effects\ 2025/aerender -project {jobpath} -comp {comp} -mp -output {locationpath}',
jobpath=work_doc, jobpath=work_doc,
comp=event_id, comp=event_id,
locationpath=intermediate_clip) locationpath=intermediate_clip)
if platform.system() == 'Windows': if platform.system() == 'Windows':
run(r'C:/Program\ Files/Adobe/Adobe\ After\ Effects\ 2024/Support\ Files/aerender.exe -project {jobpath} -comp {comp} -mp -output {locationpath}', run(r'C:/Program\ Files/Adobe/Adobe\ After\ Effects\ 2025/Support\ Files/aerender.exe -project {jobpath} -comp {comp} -mp -output {locationpath}',
jobpath=work_doc, jobpath=work_doc,
comp=event_id, comp=event_id,
locationpath=intermediate_clip) locationpath=intermediate_clip)
@ -231,28 +230,21 @@ def enqueue_job(event):
copyfile(args.project+args.introfile, work_doc) copyfile(args.project+args.introfile, work_doc)
if platform.system() == 'Darwin': if platform.system() == 'Darwin':
copyfile(args.project+'intro.scpt', ascript_doc)
run('osascript {ascript_path} {scriptpath}', run(r'''osascript -l JavaScript -e "ae = Application('Adobe After Effects 2025'); ae.activate(); ae.doscriptfile('{scriptpath}');"''',
scriptpath=script_doc, scriptpath=script_doc)
ascript_path=ascript_doc)
# run('osascript {ascript_path} {jobpath} {scriptpath}', run(r'/Applications/Adobe\ After\ Effects\ 2025/aerender -project {jobpath} -comp "intro" -mp -output {locationpath}',
# jobpath=work_doc,
# scriptpath=script_doc,
# ascript_path=ascript_doc)
run(r'/Applications/Adobe\ After\ Effects\ 2024/aerender -project {jobpath} -comp "intro" -mp -output {locationpath}',
jobpath=work_doc, jobpath=work_doc,
locationpath=intermediate_clip) locationpath=intermediate_clip)
if platform.system() == 'Windows': if platform.system() == 'Windows':
run_once(r'C:/Program\ Files/Adobe/Adobe\ After\ Effects\ 2024/Support\ Files/AfterFX.exe -noui -r {scriptpath}', run_once(r'C:/Program\ Files/Adobe/Adobe\ After\ Effects\ 2025/Support\ Files/AfterFX.exe -noui -r {scriptpath}',
scriptpath=script_doc) scriptpath=script_doc)
time.sleep(5) time.sleep(5)
run(r'C:/Program\ Files/Adobe/Adobe\ After\ Effects\ 2024/Support\ Files/aerender.exe -project {jobpath} -comp "intro" -mfr on 100 -output {locationpath}', run(r'C:/Program\ Files/Adobe/Adobe\ After\ Effects\ 2025/Support\ Files/aerender.exe -project {jobpath} -comp "intro" -mfr on 100 -output {locationpath}',
jobpath=work_doc, jobpath=work_doc,
locationpath=intermediate_clip) locationpath=intermediate_clip)
if args.debug or args.keep: if args.debug or args.keep:

Binary file not shown.

5196
voc_ae/intro.aepx Normal file

File diff suppressed because one or more lines are too long

View file

@ -1,3 +1,4 @@
app.open(new File("$filename"));
var comp; var comp;
for (var i = 1; i <= app.project.numItems; i ++) { for (var i = 1; i <= app.project.numItems; i ++) {
if ((app.project.item(i) instanceof CompItem) && (app.project.item(i).name === 'intro')) { if ((app.project.item(i) instanceof CompItem) && (app.project.item(i).name === 'intro')) {
@ -19,5 +20,4 @@ textProp_title.setValue(textDocument_title);
textDocument_persons.text = "$personnames"; textDocument_persons.text = "$personnames";
textProp_persons.setValue(textDocument_persons); textProp_persons.setValue(textDocument_persons);
app.project.save(); app.project.close(CloseOptions.SAVE_CHANGES);
app.quit();

Binary file not shown.