Created
April 16, 2011 01:22
-
-
Save topfunky/922752 to your computer and use it in GitHub Desktop.
Render After Effects sketches
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
AFTER_EFFECTS_EXPORT_DIRECTORY = "film/after_effects" | |
rule ".mov" => proc {|task_name| | |
task_name.sub(/\.mov/, | |
'.aep').sub(AFTER_EFFECTS_EXPORT_DIRECTORY, | |
'artwork/after_effects') } do |t| | |
if !t.name.match("Adobe After Effects Auto-Save") | |
puts "Rendering #{t.source} to #{t.name}" | |
output_template = "Animation" | |
if (t.source =~ /-t-/) | |
output_template = "Lossless with Alpha (Straight)" | |
end | |
mkdir_p File.dirname(File.expand_path(t.name)) | |
if File.exist?(File.expand_path(t.name)) | |
rm File.expand_path(t.name) | |
end | |
command = ["'/Applications/Adobe After Effects CS5/aerender'", | |
# "-reuse", # Launch one instance of AE, or use existing. Faster. | |
%(-project "#{File.expand_path(t.source)}"), | |
%(-comp "Comp 1"), | |
%(-RStemplate "Best Settings - Full Comp"), # Render template | |
%(-OMtemplate "#{output_template}"), # Output template | |
"-mp", # Use multicore | |
"-v ERRORS", | |
"-close DO_NOT_SAVE_CHANGES", | |
"-sound ON", | |
%(-output "#{File.expand_path(t.name)}")] | |
system(command.join(' ')) | |
rm_rf t.source + " Logs" | |
end | |
end | |
rule ".mov" => proc {|task_name| | |
task_name.sub(/\.mov/, | |
'.aep').sub(AFTER_EFFECTS_EXPORT_DIRECTORY, | |
'artwork-ii/after_effects') } do |t| | |
if !t.name.match("Adobe After Effects Auto-Save") | |
puts "Rendering #{t.source} to #{t.name}" | |
output_template = "Lossless" | |
if (t.source =~ /-t-/) | |
output_template = "Lossless with Alpha (Straight)" | |
end | |
mkdir_p File.dirname(File.expand_path(t.name)) | |
command = ["'/Applications/Adobe After Effects CS4/aerender'", | |
"-reuse", # Launch one instance of AE, or use existing. Faster. | |
%(-project "#{File.expand_path(t.source)}"), | |
%(-comp "Comp 1"), | |
%(-RStemplate "Best Settings"), # Render template | |
%(-OMtemplate "#{output_template}"), # Output template | |
"-mp", # Use multicore | |
"-v ERRORS", | |
"-close DO_NOT_SAVE_CHANGES", | |
"-sound ON", | |
%(-output "#{File.expand_path(t.name)}")] | |
system(command.join(' ')) | |
rm_rf t.source + " Logs" | |
end | |
end | |
task :create_output_directory do | |
mkdir_p AFTER_EFFECTS_EXPORT_DIRECTORY | |
end | |
MOV_FILES = Dir['artwork/after_effects/**/[0-9]*.aep'].map {|t| t.sub(/artwork\/after_effects/, AFTER_EFFECTS_EXPORT_DIRECTORY).sub(/\.aep/, '.mov')} | |
desc "Render After Effects files" | |
task :render => [:create_output_directory, MOV_FILES].flatten | |
task :default => :render |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment