devtud / aerender Goto Github PK
View Code? Open in Web Editor NEWPython asyncio wrapper for Adobe After Effects' aerender
Home Page: https://github.com/devtud/aerender
Python asyncio wrapper for Adobe After Effects' aerender
Home Page: https://github.com/devtud/aerender
I think it's has something to do with a plugin (Saber) but after running aerender it keeps running doing nothing after this:
PROGRESS: Total Time Elapsed: 1 Min, 2 Sec
So I found your aerender wrapper which is helpfull but my knowledge is limited with asyncio.
I tried a couple things:
#in this function async def check_and_raise(log_line: str):
#and also here in the async for log_line, log_tag in stdout_log_generator
if 'Total Time Elapsed' in log_line:
process_task.stop()
#
process_task.cancel()
#
process_task.done()
it stops but very messy and after rendering I would like to some other stuff...
Is there away to stop nicely?
Example out after stopping with stop()
DEBUG:asyncio:taking long time to close proactor
Traceback (most recent call last):
File "test.py", line 19, in <module>
asyncio.run(coro)
File "C:\Users\marc.otten\AppData\Local\Programs\Python\Python37\lib\asyncio\runners.py", line 43, in run
return loop.run_until_complete(main)
File "C:\Users\marc.otten\AppData\Local\Programs\Python\Python37\lib\asyncio\base_events.py", line 584, in run_until_complete
return future.result()
File "C:\Users\marc.otten\Documents\mmogon-v2\venv\lib\site-packages\aerender\wrapper.py", line 112, in run
result = await self.run_command(command)
File "C:\Users\marc.otten\Documents\mmogon-v2\venv\lib\site-packages\aerender\wrapper.py", line 160, in run_command
await check_and_raise(log_line)
File "C:\Users\marc.otten\Documents\mmogon-v2\venv\lib\site-packages\aerender\wrapper.py", line 141, in check_and_raise
process_task.stop()
AttributeError: '_asyncio.Task' object has no attribute 'stop'
Exception ignored in: <function BaseSubprocessTransport.__del__ at 0x000001FFB3E69048>
Traceback (most recent call last):
File "C:\Users\marc.otten\AppData\Local\Programs\Python\Python37\lib\asyncio\base_subprocess.py", line 127, in __del__
File "C:\Users\marc.otten\AppData\Local\Programs\Python\Python37\lib\asyncio\base_subprocess.py", line 104, in close
File "C:\Users\marc.otten\AppData\Local\Programs\Python\Python37\lib\asyncio\proactor_events.py", line 86, in close
File "C:\Users\marc.otten\AppData\Local\Programs\Python\Python37\lib\asyncio\base_events.py", line 688, in call_soon
File "C:\Users\marc.otten\AppData\Local\Programs\Python\Python37\lib\asyncio\base_events.py", line 480, in _check_closed
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000001FFB3E6B400>
Traceback (most recent call last):
File "C:\Users\marc.otten\AppData\Local\Programs\Python\Python37\lib\asyncio\proactor_events.py", line 95, in __del__
File "C:\Users\marc.otten\AppData\Local\Programs\Python\Python37\lib\asyncio\proactor_events.py", line 86, in close
File "C:\Users\marc.otten\AppData\Local\Programs\Python\Python37\lib\asyncio\base_events.py", line 688, in call_soon
File "C:\Users\marc.otten\AppData\Local\Programs\Python\Python37\lib\asyncio\base_events.py", line 480, in _check_closed
RuntimeError: Event loop is closed
Is there anyway to still use this code in conjunction?
It seems this line will just skip over....
asyncio.run(coro)
is there an exit hook?
I'm currently using zmq to great effect - maybe I'll have to mangle the script to shoot out a message.
import asyncio
import zmq
import sys
from pathlib import Path
import os
from aerender import AERenderWrapper
asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
port = 5555
if name == 'main':
context = zmq.Context()
socket = context.socket(zmq.SUB)
socket.setsockopt(zmq.SUBSCRIBE, b'')
socket.connect('tcp://192.168.1.110:%i' % port)
while True:
msg = socket.recv_pyobj()
print("%s:" % msg)
if msg['event'] == 'startProcessing' :
AERENDER_FULLPATH = Path('C:\\Program Files\\Adobe\\Adobe After Effects 2020\\Support Files\\aerender.exe')
aerender = AERenderWrapper(exe_path=AERENDER_FULLPATH)
coro = aerender.run(
project_path=Path("C:\\Users\\jp\\Documents\\gitWorkspace\\coop\\aws-swf-python\\render\\profile.aep"),
comp_name='render',
output_path=Path('C:\\Users\\jp\\Documents\\gitWorkspace\\coop\\aws-swf-python\\render\\profile.mov'),
)
asyncio.run(coro)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.