项目作者: devtud

项目描述 :
Python asyncio wrapper for Adobe After Effects' aerender
高级语言: Python
项目地址: git://github.com/devtud/aerender.git
创建时间: 2019-09-08T13:48:49Z
项目社区:https://github.com/devtud/aerender

开源协议:

下载


aerender

Render Adobe After Effects projects using Python

aerender is an asyncio wrapper over aerender (Adobe After Effects 2019)
built and tested on Windows 10. It can be used to automate the rendering of
After Effects projects.

Install it

  1. pip install aerender

Usage example

  • To render just Comp 1 to a specified file:
  1. import asyncio
  2. from pathlib import Path
  3. from aerender import AERenderWrapper
  4. asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
  5. if __name__ == '__main__':
  6. AERENDER_FULLPATH = Path('C:/Program Files/Adobe/Adobe After Effects CC 2019/Support Files/aerender')
  7. aerender = AERenderWrapper(exe_path=AERENDER_FULLPATH)
  8. coro = aerender.run(
  9. project_path=Path('C:/projects/proj1.aep'),
  10. comp_name='Comp 1',
  11. output_path=Path('C:/output/proj1/proj1.avi'),
  12. )
  13. asyncio.run(coro)

aerender -help

Below you can see the -help output of aerender executable on Windows.

USAGE:

  1. aerender renders After Effects comps. The render may be performed either
    by an already running instance of AE or by a newly invoked instance. By
    default, aerender will invoke a new instance of AE, even if one is
    already running. To change this, see the -reuse flag below.

  2. aerender takes a series of optional arguments.

    Some are single flags, like -reuse. Some come in flag-argument
    pairs, like -project project_path. And one comes in a triplet,
    -mem_usage image_cache_percent max_mem_percent.

  3. aerender with 0 arguments, or with any argument equaling -help
    or -h, prints this usage message.

  4. The arguments are:

    • -h print this usage message

    • -help print this usage message

    • -reuse use this flag if you want to try and reuse

      1. an already running instance of AE to perform the
      2. render. By default, aerender will launch a new
      3. instance of After Effects, even if one is already
      4. running. But, if AE is already running, and the
      5. `-reuse` flag is provided, then `aerender` will
      6. ask the already running instance of AE to perform
      7. the render. Whenever `aerender` launches a new
      8. instance of AE, it will tell AE to quit when
      9. rendering is completed; otherwise, it will not
      10. quit AE. Also, the preferences will be written
      11. to file upon quit when the `-reuse` flag is
      12. specified; otherwise it will not be written.
    • -project project_path

      1. where **`project_path`** is a file path or URI
      2. specifying a project file to open.
      3. If none is provided, aerender will work with the
      4. currently open project.
      5. If no project is open and no project is provided,
      6. an error will result.
    • -teamproject project_name

      1. where **`project_name`** is a name of a
      2. team project to open.
    • -comp comp_name

      1. where **`comp_name`** specifies a comp to be rendered.
      2. If the comp is in the render queue already, and
      3. in a queueable state, then (only) the first
      4. queueable instance of that comp on the render
      5. queue will be rendered. If the comp is in the
      6. project but not in the render queue, then it will
      7. be added to the render queue and rendered.
      8. If no `-comp` argument is provided, `aerender` will
      9. render the entire render queue as is. In this
      10. case (no `-comp`), the only other arguments used
      11. will be `-project`, `-log`, `-v`, `-mem_usage`, and
      12. `-close`; the `-RStemplate`, `-OMtemplate`, `-output`,
      13. `-s`, `-e`, and `-i` arguments will be ignored.
    • -rqindex index_in_render_queue

      1. where **`index_in_render_queue`** specifies a
      2. render queue item to be rendered. Options that make
      3. sense when rendering a single render queue item
      4. are available like with the `-comp` flag.
    • -RStemplate render_settings_template

      1. where **`render_settings_template`**
      2. is the name of a template to apply to the render
      3. queue item.If the template does not exist it is
      4. an error.
      5. Default is to use the render template already
      6. defined for the item.
    • -OMtemplate output_module_template

      1. where **`output_module_template`**
      2. is the name of a template to apply to the
      3. output module. If the template does not exist
      4. it is an error.
      5. Default is to use the template already defined
      6. for the output module.
    • -output output_path

      1. where **`output_path`** is a file path or URI
      2. specifying the destination render file.
      3. Default is the path already in the project file.
    • -log logfile_path

      1. where **`logfile_path`** is a file path or URI
      2. specifying the location of the log file.
      3. Default is stdout.
    • -s start_frame

      1. where **`start_frame`** is the first frame to render.
      2. Default is the start frame in the file.
    • -e end_frame

      1. where **`end_frame`** is the last frame to render.
      2. Note, this is "inclusive;" the final frame
      3. will be rendered.
      4. Default is the end frame in the file.
    • -i increment

      1. where **`increment`** is the number of frames to
      2. advance before rendering a new frame. A value
      3. of 1 (the default) results in a normal rendering
      4. of all frames. Higher increments will repeat the
      5. same (frame increment-1) times and then render a
      6. new one, starting the cycle again. Higher values
      7. result in faster renders but choppier motion.
      8. Default is 1.
    • -mem_usage image_cache_percent max_mem_percent

      1. where **`image_cache_percent`** specifies the maximum
      2. percent of memory used to cache already rendered
      3. images/footage, and **`max_mem_percent`** specifies
      4. the total percent of memory that can be
      5. used by After Effects.
    • -v verbose_flag

      1. where **`verbose_flag`** specifies the type of
      2. messages reported. Possible values are `ERRORS`
      3. (prints only fatal and problem errors) or
      4. `ERRORS_AND_PROGRESS` (prints progress of rendering
      5. as well).
      6. Default value is `ERRORS_AND_PROGRESS`.
    • -close close_flag

      1. where **`close_flag`** specifies whether or not to
      2. close the project when done rendering, and
      3. whether or not to save changes. If close_flag is
      4. `DO_NOT_SAVE_CHANGES`, project will be closed
      5. without saving changes. If close_flag is
      6. `SAVE_CHANGES`, project will be closed and changes
      7. will be saved. If close_flag is `DO_NOT_CLOSE` the
      8. project will be left open; but the project is
      9. left open only if using an already-running
      10. instance of AE, since new invocations of AE must
      11. always close and quit when done.
      12. Default value is `DO_NOT_SAVE_CHANGES`.
    • -sound sound_flag

      1. where **`sound_flag`** specifies whether or not to play
      2. a sound when rendering is complete. Possible
      3. values are "`ON`" or "`OFF`".
      4. Default value is "`OFF`".
    • -version

      1. displays the version number of aerender to the
      2. console. Does not render.
    • -continueOnMissingFootage

      1. Do not stop rendering on missing footage. Log and
      2. render with placeholder color bars.
  5. EXAMPLES:
    To render just Comp 1 to a specified file:

    1. aerender -project c:\projects\proj1.aep -comp "Comp 1"
    2. -output c:\output\proj1\proj1.avi

    To render everything in the render queue as is in the project file:

    1. aerender -project c:\projects\proj1.aep

    To render frames 1-10 using multi-machine render:

    1. aerender -project c:\projects\proj1.aep -comp "Comp 1" -s 1 -e 10
    2. -RStemplate "Multi-Machine Settings"
    3. -OMtemplate "Multi-Machine Sequence"
    4. -output c:\output\proj1\frames[####].psd