Created
March 11, 2023 06:47
-
-
Save cbaclig/573133920f9bc312983de057b9e85220 to your computer and use it in GitHub Desktop.
AE Templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(gAECommandLineRenderer){ | |
// Edit > Templates > Render Settings... | |
var BASE_RENDER_SETTINGS_TEMPLATE = "Best Settings"; | |
var RENDER_SETTINGS_TEMPLATES_TO_CREATE = { | |
"Fast (Editing)": { | |
"Resolution": "Quarter", | |
"Use this frame rate": 12, | |
"Motion Blur": "Off for All Layers", | |
"Color Depth": "8 bits per channel" | |
}, | |
}; | |
// Edit > Templates > Output Settings... | |
var OUTPUT_SETTINGS_TEMPLATES_TO_CREATE = { | |
"Fast (Editing)": { | |
template: "H.264 - Match Render Settings - 5 Mbps" | |
}, | |
}; | |
function isInArray(needle, haystack) { | |
return gAECommandLineRenderer.IsInArray(needle, haystack); | |
} | |
var stubComp = app.project.items.addComp("Test Comp", 100,100, 1, 1, 30); | |
var renderQueueItem = app.project.renderQueue.items.add(stubComp); | |
for (var templateName in RENDER_SETTINGS_TEMPLATES_TO_CREATE) { | |
if (!isInArray(templateName, renderQueueItem.templates)) { | |
// Use an existing template as a starting point | |
renderQueueItem.applyTemplate(BASE_RENDER_SETTINGS_TEMPLATE); | |
renderQueueItem.setSettings(RENDER_SETTINGS_TEMPLATES_TO_CREATE[templateName]); | |
renderQueueItem.saveAsTemplate(templateName); | |
} | |
} | |
var outputModule = renderQueueItem.outputModule(1); | |
for (var templateName in OUTPUT_SETTINGS_TEMPLATES_TO_CREATE) { | |
if (!isInArray(templateName, outputModule.templates)) { | |
var outputSettingsProps = OUTPUT_SETTINGS_TEMPLATES_TO_CREATE[templateName]; | |
outputModule.applyTemplate(outputSettingsProps.template); | |
outputModule.saveAsTemplate(templateName); | |
} | |
} | |
// Cleanup | |
stubComp.remove(); | |
})(gAECommandLineRenderer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment