benzed / after-effects Goto Github PK
View Code? Open in Web Editor NEWSend instructions from node.js to the After Effects scripting environment.
License: MIT License
Send instructions from node.js to the After Effects scripting environment.
License: MIT License
Hi,
I figured out that in some cases, if the response contains \n or \r characters, it is not escaped. So the js files are broken because strings are only on 1 line.
Do you have the time to investigate ?
Thanks
Hello,
It would be great to have a method to assert that after effects is launched, thus increasing highly the performances of scripts using your after-effects package. Currently, if after-effect is not running, it is launched and stopped at each call to ae().
Do you think you could integrate this functionality ?
Best Regards,
Pierre-Emmanuel Lallemant
Hey,
How do you recommend working with multiple jsx script files?
I'd love to import/require stuff, but of course it is not possible because of the limitations that exists with the environment. What workaround could maybe do the work?
I think StandardJS is best standard for NodeJS, so if you agree I will can change this code to SJS.
Passed variables to AE will fail if minify is set to true.
I have tested this on Windows only.
const projectPath = "some/path/to/aep";
ae.options.minify = true;
ae((path: string) => {
const project = new File(path); // <-- path is undefined
app.open(project);
}, projectPath);
Hi @BenGaumond. Impressive work you did there. I invited you to our Extendscript org here on GitHub. Maybe you have something to contribute. Even if not we are happy to just grow the org with people who bring scripting for Adobe application to the next level. Your invite should be visible under https://github.com/ExtendScript or should have reached you via mail.
I get this error, although 'Allow Scripts to Write ...' is enabled in my AE.
Could not get results from After Effects. Ensure that Preferences > General > Allow Scripts to Write Files and Access Network is enabled.
Any idea why is this happening or how can I debug this?
I'm seeing TypeError: is is not a function
errors on a simple test scene:
var ae = require('after-effects');
ae(() => alert("Hello!\nFrom node.js"));
The solution is to downgrade is-explicit. I dropped from 1.0.6 to 1.0.1 and the test above works without error.
Flagging for @mikkoh and @mattdesl, as it I originally encountered this #while trying to use ae-to-json.
I'm using the module on after effects cc 2019.>
it keeps telling me "Could not get results from After Effects. Ensure that Preferences > General > Allow Scripts to Write Files and Access Network is enabled.'
I've changed those settings and still get the error.
wondering if it's still working for this version of after effects.
The new update broke my app.
Error: Cannot find module 'after-effects'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
I had to use the old one I downloaded last week.
//here is code
var path = require("path");
var ae = require("after-effects");
ae.options.program = path.join("C:","Adobe_After_Effects_CC","Adobe After Effects CC");
ae(() => alert("Hello!\nFrom node.js"));
//end code
fs.js:904
return binding.readdir(pathModule._makeLong(path), options.encoding);
^
Error: ENOENT: no such file or directory, scandir 'C:\Program Files\Adobe'
at Object.fs.readdirSync (fs.js:904:18)
at find_program (E:\ae_script\node_test\node_modules\after-effects\lib\platform-win.js:18:35)
at Object. (E:\ae_script\node_test\node_modules\after-effects\lib\platform-win.js:58:17)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
calling get() takes about 1.5 seconds. calling it 4 times takes ~6s, Is it just for me?
My project is super super small, just animating 2 text layers and 1 image.
Constructing Error
objects ahead of time as in https://github.com/BenGaumond/after-effects/blob/master/index.js#L50-L53 hinders debugging as it hides the actual call stack of the error. I'm debugging a different issue right now, might get around to submitting a PR later.
Hi,
When I write $.writeln("Tracé rectangulaire 1")
in a script sent via your package, it displays" Tracé rectangulaire 1".
The same code works on scripts executed in local.
Replicate:
> node
> ae = require('ae');
> ae.execute(() => get())
.then(val => console.log(val))
.catch(err => console.log(err);
Outputs...
{ [AfterEffectsError: types, if supplied, are expected to be non-anonymous Function definitions.] name: 'AfterEffectsError' }
Hi,
get API is really useful. thank you.
I noticed get API cannot fetch FootageItem. Does it work well on your side?
$.writeln(get.footage().count()); // 0
$.writeln(get(FolderItem).count()); // 7
$.writeln(get(FolderItem, FootageItem).count()); // 34
$.writeln(get(FootageItem).count()); // 0
it happens on AE 2015, 2017.
Hi, I've been using this package for a short while with great success. One thing I've stumbled upon is that if After Effects is not already open, it looks like running a command will launch after effects which is great. However, it looks to be closing after effects after the command has returned/completed.
Is there a way to make after effects remain open?
Hi there! cool package!
Are you aware of CEP? It allows you to use node.js in panels =)
I made a project recently that you might be interested in: https://github.com/vespakoen/modern-extendscript
It allows console.logging from ExtendScript (will serialize / log to the chrome remote debugger)
And does LiveReloading on save.
Check it out, you might find it useful ;)
In index.js
the platform check function uses the Errors
constants to throw an appropriate error. However, since const
values don't get hoisted Errors
is undefined at line 39: throw new Error(Errors.UnsupportedPlatform);
.
On my (linux) machine this causes my app to crash with ReferenceError: Errors is not defined
rather than the clearer: Error: Cannot run After Effects commands in an environment it can't be installed in.
.
No big deal (different error, woop woop), but still nice to have. I'll probably have some time to fix this myself later today, but I did want to create an issue to have this recorded somewhere :)
I found (and feel free to correct me if I'm wrong) that the codify_includes() function in command.js is joining the array of includes on a comma, which is throwing an error in AfterEffects when it tries to run the resulting jsx file.
On line 109, if you just call .join("\n");
after
}).filter(inc => is(inc,String))
it will resolve the issue where After Effects complains "Unable to execute script at line ##. , is undefined".
I'm using this library along with typescript. Thanks for this library by the way (:
But I can't use // @ts-ignore on the code that goes to AE. It looks like the @ makes the script fail on AE javascript engine.
// @ts-ignore
A workaround is to use minify = true. Doing this the error goes away.
This module is really awesome.
Do you think there is a chance that you could make it possible to refer to the After Effects instance by process id, not by application name? This way it would be possible to open multiple instances of AE and communicate with them separately. Right now only a single instance is possible.
I don't know enough AppleScript to help, but I found this:
http://stackoverflow.com/questions/12332810/applescript-user-interface-scripting-how-to-tell-a-process-when-two-process
Whenever I run my node application, it opens up aftereffects on top of other applications. Is there a way to run ae commands without opening up aftereffect UI. Like the afterfx -noui flag.
I tried googling the same and could not find proper documentation on -noui flag as well.
Is it possible to execute a script(extend script .jsx) through the node.js ? I think that would be really helpful.. Thanks!
Hi All,
I am using after-effects library, with ae-to-json package but, I am getting issues as
this.includes = [...codify_includes(this.options.includes, this.options.minify), babelIncludes];
^^^
SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
Following is the code which I am using
var aeToJSON = require('ae-to-json/after-effects');
var ae = require('after-effects');
var fs = require('fs-extra');
ae.execute(aeToJSON)
.then(function(json) {
console.log(json);
})
.catch(function(e) {
throw e;
});
--Please correct me If I am missing some thing.
After using sudo, OS Tmpdir() and JSX folder temp. If the absoluteuri is inconsistent, but sudo is not used, there is no permission
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.