Python для after effects

aerender

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

Usage example

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

  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 an already running instance of AE to perform the render. By default, aerender will launch a new instance of After Effects, even if one is already running. But, if AE is already running, and the -reuse flag is provided, then aerender will ask the already running instance of AE to perform the render. Whenever aerender launches a new instance of AE, it will tell AE to quit when rendering is completed; otherwise, it will not quit AE. Also, the preferences will be written to file upon quit when the -reuse flag is specified; otherwise it will not be written.
    • -project project_path where project_path is a file path or URI specifying a project file to open. If none is provided, aerender will work with the currently open project. If no project is open and no project is provided, an error will result.
    • -teamproject project_name where project_name is a name of a team project to open.
    • -comp comp_name where comp_name specifies a comp to be rendered. If the comp is in the render queue already, and in a queueable state, then (only) the first queueable instance of that comp on the render queue will be rendered. If the comp is in the project but not in the render queue, then it will be added to the render queue and rendered. If no -comp argument is provided, aerender will render the entire render queue as is. In this case (no -comp ), the only other arguments used will be -project , -log , -v , -mem_usage , and -close ; the -RStemplate , -OMtemplate , -output , -s , -e , and -i arguments will be ignored.
    • -rqindex index_in_render_queue where index_in_render_queue specifies a render queue item to be rendered. Options that make sense when rendering a single render queue item are available like with the -comp flag.
    • -RStemplate render_settings_template where render_settings_template is the name of a template to apply to the render queue item.If the template does not exist it is an error. Default is to use the render template already defined for the item.
    • -OMtemplate output_module_template where output_module_template is the name of a template to apply to the output module. If the template does not exist it is an error. Default is to use the template already defined for the output module.
    • -output output_path where output_path is a file path or URI specifying the destination render file. Default is the path already in the project file.
    • -log logfile_path where logfile_path is a file path or URI specifying the location of the log file. Default is stdout.
    • -s start_frame where start_frame is the first frame to render. Default is the start frame in the file.
    • -e end_frame where end_frame is the last frame to render. Note, this is «inclusive;» the final frame will be rendered. Default is the end frame in the file.
    • -i increment where increment is the number of frames to advance before rendering a new frame. A value of 1 (the default) results in a normal rendering of all frames. Higher increments will repeat the same (frame increment-1) times and then render a new one, starting the cycle again. Higher values result in faster renders but choppier motion. Default is 1.
    • -mem_usage image_cache_percent max_mem_percent where image_cache_percent specifies the maximum percent of memory used to cache already rendered images/footage, and max_mem_percent specifies the total percent of memory that can be used by After Effects.
    • -v verbose_flag where verbose_flag specifies the type of messages reported. Possible values are ERRORS (prints only fatal and problem errors) or ERRORS_AND_PROGRESS (prints progress of rendering as well). Default value is ERRORS_AND_PROGRESS .
    • -close close_flag where close_flag specifies whether or not to close the project when done rendering, and whether or not to save changes. If close_flag is DO_NOT_SAVE_CHANGES , project will be closed without saving changes. If close_flag is SAVE_CHANGES , project will be closed and changes will be saved. If close_flag is DO_NOT_CLOSE the project will be left open; but the project is left open only if using an already-running instance of AE, since new invocations of AE must always close and quit when done. Default value is DO_NOT_SAVE_CHANGES .
    • -sound sound_flag where sound_flag specifies whether or not to play a sound when rendering is complete. Possible values are » ON » or » OFF «. Default value is » OFF «.
    • -version displays the version number of aerender to the console. Does not render.
    • -continueOnMissingFootage Do not stop rendering on missing footage. Log and render with placeholder color bars.
  5. EXAMPLES: To render just Comp 1 to a specified file:
aerender -project c:\projects\proj1.aep -comp "Comp 1" -output c:\output\proj1\proj1.avi 
aerender -project c:\projects\proj1.aep 
aerender -project c:\projects\proj1.aep -comp "Comp 1" -s 1 -e 10 -RStemplate "Multi-Machine Settings" -OMtemplate "Multi-Machine Sequence" -output c:\output\proj1\frames[####].psd 

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Python scripting plugin for After Effects

License

takeshi-okuya/AEPython

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Python scripting plugin for After Effects

Read this document in other languages: Japanese

  • Directly edit data on After Effects with Python scripts
  • Enabled to use classes and functions with the same names as After Effects default scripts (ExtendScript, JavaScript)
    • Class and function reference: https://ae-scripting.docsforadobe.dev/introduction/overview.html
    • Adobe After Effects CS6 / CC~
    • Windows 10 / 11
    • Python 3.10.9 (included in the distribution Zip)

    Copy each files and folders in the distribution Zip to the following locations.

    • AEPython folder -> C:\Program Files\Adobe\Adobe After Effects \Support Files\Plug-ins\AEPython
    • AEPython.jsx -> C:\Program Files\Adobe\Adobe After Effects \Support Files\Scripts\Startup\AEPython.jsx

    Run Python scripts from the Python Window

    Select menu: Window -> Python

    comp = ae.app.project.items.addComp("Comp1", 1920, 1080, 1, 10, 24) comp.bgColor = [1.0, 1.0, 1.0] text_layer = comp.layers.addText("This is an AE Python sample.") text_prop = text_layer.property("Source Text") text_document = text_prop.value text_document.fontSize = 50 text_prop.setValue(text_document)

    Run .py files from the Python Window

    Select .py file from File -> «Execute Python File» in the AEPython window.

    import AEPython as ae ae.alert(ae.app.project.file)

    Run Python scripts from ExtendScript

    Python.exec("ae.app.project.activeItem.name = 'New Name'");

    Run .py files from ExtendScript

    from PySide2 import QtWidgets import AEPython as ae import qtae class MyDialog(QtWidgets.QDialog): def __init__(self, parent=None): super().__init__(parent) layout = QtWidgets.QVBoxLayout() self.text_input = QtWidgets.QLineEdit("") layout.addWidget(self.text_input) self.button = QtWidgets.QPushButton("Add Text Layer!") self.button.clicked.connect(self.onButtonClicked) layout.addWidget(self.button) self.setLayout(layout) def onButtonClicked(self): text = self.text_input.text() layer = ae.app.project.activeItem.layers.addText(text) layer.position.setValue([100,100]) dialog = MyDialog(qtae.GetQtAEMainWindow()) dialog.show()

    About

    Python scripting plugin for After Effects

    Источник

    Saved searches

    Use saved searches to filter your results more quickly

    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

    Scripting in After Effects is used to automate a wide variety of repetitive task or as complex as an entire new feature

    samholt/after-effects-scripting-python

    This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

    Name already in use

    A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

    Sign In Required

    Please sign in to use Codespaces.

    Launching GitHub Desktop

    If nothing happens, download GitHub Desktop and try again.

    Launching GitHub Desktop

    If nothing happens, download GitHub Desktop and try again.

    Launching Xcode

    If nothing happens, download Xcode and try again.

    Launching Visual Studio Code

    Your codespace will open once ready.

    There was a problem preparing your codespace, please try again.

    Latest commit

    Git stats

    Files

    Failed to load latest commit information.

    README.md

    After Effects Scripting in Python WIP

    Scripting in After Effects is used to automate repetitive tasks and are often used as a creative tool to streamline tasks that might be too time consuming to do manually. For example, you could write a script to generate a number of localized versions of a particular image or to gather information about the various color profiles used by a collection of images.

    After Effects can be scripted through COM(Component Object Model). Its DOM(Document Object Model) is the same when accessing it through either its own JavaScript engine or Python or any other scripting language it supports. The Photoshop DOM consists of a hierarchical representation of the AE (After Effects) application, the documents used in it, and the components of the documents. The DOM allows you to programmatically access and manipulate the document and its components. For example, through the DOM, you can create a new document, add a layer to an existing document, or change the background color of a layer. Most of the functionality available through the Photoshop user interface is available through the DOM.

    AE scripting officially supports JavaScript, AppleScript & VBScript. However, Scripting in Python is also fairly easy if not easier if you’re already comfortable with Python. You may have already heard that Python is gaining in popularity, but did you know it’s now the most popular introductory programming language in U.S. universities? Python is also cross platform just like JavaScript is and lately becoming one of the fastest growing programming language according to StackOverflow as of September 2017

    Python is easy to use, powerful, and versatile, making it a great choice for beginners and experts alike. Python’s readability makes it a great first programming language — it allows you to think like a programmer and not waste time understanding the mysterious syntax that other programming languages can require.

    Python allows you to access COM and it’s DOM with the help of a Python extensions like «pypiwin32» or «comtypes». Install these modules and you’re ready to start scripting Photoshop in Python

    Test example, to try to connect (WIP)

    from win32com.client import Dispatch app = Dispatch("AfterEffects.Application") # At present this errors, still trying to find the correct COM Object Model ID, to go in the above function call

    About

    Scripting in After Effects is used to automate a wide variety of repetitive task or as complex as an entire new feature

    Источник

    Читайте также:  Running games for java
Оцените статью