Giter Site home page Giter Site logo

trentonom0r3 / pyshiftae Goto Github PK

View Code? Open in Web Editor NEW
23.0 23.0 1.0 59.67 MB

Python for After Effects! PyShiftAE is an Open Source .aex plugin designed to serve as a full replacement for After Effects Extendscript.

License: GNU Affero General Public License v3.0

C++ 34.85% C 64.38% Rez 0.77%
adobe-sdk after-effects after-effects-python after-effects-sdk cep open-source python sdk

pyshiftae's Introduction

Hi there ๐Ÿ‘‹

About Me

Hiya! I'm Trenton, a 26-year-old Native-American Filmmaker and Photographer with a knack for programming. By trade, I delve into the realms of film and photography, and by education, I am a Mechanical Engineer.

What I'm Doing

  • ๐ŸŒŸ Programming Journey: Began in April 2023, fueling a non-stop exploration into coding.
  • ๐ŸŽจ Creative Problem Solving: Leveraging my artistic skills and engineering mindset to develop innovative workflows.
  • ๐Ÿ“š Learning Curve: Amateur in Python, JavaScript, and getting my hands dirty with C/C++.
  • ๐Ÿ’ก Art Meets Code: Transforming creative visions into tangible projects through coding. Check out my projects
    • AETK
      • A Modern C++ Library around the After Effects SDK.
    • AEvolution
      • A brand new plugin for after effects providing a framework to write bindings to script in any language!
    • ezsynth
      • Ebsynth for Python.
    • PyShiftAE
      • An After Effects Plugin exposing Python as a replacement for ExtendScript.
    • After-Diffusion
      • Auto1111 Stable Diffusion in After Effects.

My Goals

  • ๐Ÿš€ Formal Training: Eager to blend my existing skills with formal coding knowledge for a unique perspective in tech.
  • ๐Ÿค Collaborations: Open to opportunities that blend technology, art, and community impact.

Find Me Elsewhere

  • ๐Ÿ“ธ Instagram: Dive into my world of photography.

Let's Connect

Feel free to reach out for collaborations or just a chat about tech, art, or anything in between!

pyshiftae's People

Contributors

trentonom0r3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

kukupigs

pyshiftae's Issues

Can not run?

Describe the bug
AE Error alert: After Effects cant continue. PyshiftAe plugin generated an unexpected exception

To Reproduce
Steps to reproduce the behavior:

  1. I have dowbload PSC.exe and install it, and click the right path to install ""E:\adobe\Adobe After Effects 2022\Support Files\Plug-ins\Effects\PyShiftAE.aex"
  2. Reload ae, and Click on run .py
  3. See error

my test.py

from PyShiftCore import *

app.beginUndoGroup("My Undo Group")
name = app.project.name
print(name)
app.endUndoGroup()

Desktop (please complete the following information):
Windows10 22H2 19045
AE 22.6.0

Issues with accessing class methods in a loop

Let's say I'm trying to run something like this;

from PyShiftCore import *
import traceback

item = app.project.activeItem
length = item.duration

if isinstance(item, CompItem):  # Check if item is a CompItem
    try:
        for i in range( 1, int( length ) - 1 ):  # Loop through all frames

            img = item.frameAtTime(i)  # Get frame

            new_img = some_function() # manipulate the image

        item.replaceFrameAtTime( new_img, i ) # replace frame at the given time

    except Exception as e:
        print("Error:", str(e))
        traceback.print_exc()
else:
    print("Active item is not a CompItem")

When doing so, the UI freezes, AE becomes unresponsive, and the majority of the time, crashes.

Potential Source of Issue:

  • It could be buffer/memory related. This would be the most "straightforward" (albeit still complex) issue to go about solving. From what I can see so far, every acquisition has a corresponding release. Nothing is modified when it should not be. However, some user interaction and any change (position, content, etc) to items or the project would invalidate previous pointers.

  • It could be a limitation of AEGPs and AE in general. I've noticed that when I break the calls up into 1 AEGP call for 1 python method/attribute, I don't see any issues, even in loops. (however, this means new state every call, and possible issues with scripting because of this). I've also found that I can communicate to the idle hook via message streams and/or IPC, which could lead to a solution.

  • It could be related to spawning the python process on the main thread. In doing so, possibly the python processing is causing the idle hook and command hook to lock up.

Potential Solutions (for each potential issue):

  • Provided its related to pointer invalidation, implement some sort of cache/state for each python call, storing unique keys for items to reacquire and verify pointer validity for the lifetime of the script. Would require minimal refactoring, but might not be the most optimal solution. Could lead to further problems down the line.

  • Since 1 AEGP : 1 Python call runs fine, non-blocking, and can be done so in the idle hook, a moderate refactoring, exposing the classes to AE, and exposing "wrapper" classes to python that send messages to the stream telling it to do things. This would prevent the looping issue, UI blocking, but would mean we need to either implement a cache, or get a new state every call.

  • I could spawn the python process on a separate thread, use it to communicate similar to the above proposed solution.

Final Thoughts/ Proposed combined solution:

A multi-faceted, combined approach, with some extra thoughts.

  • Spawn Python in separate thread.
  • (Possibly) Make all classes and methods Read-Only. This would prevent pointer invalidation, but limit things we can do (work-around for this later)
  • Send messages from python to idle hook, 1 python method per idle hook call. Return messages to python
  • Since Python is in a separate thread, can continue processing non-blocking to the UI.

EXTRA THOUGHTS:
Existing implementation has many read only attributes, that even when ran in a loop, leads to a crash (could be quantity related though, and if so the thread idea would fix this)
If the library were to be read-only, it would limit the things we can actually do to it. However, adding a separate "utility effect" could help out with adding this extra read/write functionality

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.