Highlighted

Loading Images from After Effects to ScriptUI (ExtendScript)

Explorer ,
Aug 17, 2020

Copy link to clipboard

Copied

Is there a way to load image data from an AE FootageItem? I know how. a file based workflow works, but I'd like to get the images for my UI straight from the AE Project it modifies.

 

So, this is working: https://www.youtube.com/watch?v=CVvdykFNXAY

While this is not:

w = new Window ("palette");

var theImageFile = app.project.item(7).item(1); //an image in a folder in my AE Structure
var theImage = w.add ("image", undefined, theImageFile);

w.center();
w.show();

 

If I add +".png" to the theImageFile in theImage i get:

Corvin0_0-1597654010690.png

Makes Sense, still I try to load footage into the UI 😉

Learn multiple ways of adding images to your scripts. Whether it be a logo or an interactive button, it is a fairly simple process! -------------------------...
Adobe Community Professional
Correct answer by Mathias Moehl | Adobe Community Professional

what about this?

var theImageFile = app.project.item(7).item(1).mainSource.file;

 Each item that refers to a footage file has a mainSource property and its file property is a file object representing the actual file on disk. Note that mainSource will be undefined it the item is a comp or solid, for example.

Topics

Error or problem, How to, Scripting, SDK, User interface or workspaces

Views

43

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Loading Images from After Effects to ScriptUI (ExtendScript)

Explorer ,
Aug 17, 2020

Copy link to clipboard

Copied

Is there a way to load image data from an AE FootageItem? I know how. a file based workflow works, but I'd like to get the images for my UI straight from the AE Project it modifies.

 

So, this is working: https://www.youtube.com/watch?v=CVvdykFNXAY

While this is not:

w = new Window ("palette");

var theImageFile = app.project.item(7).item(1); //an image in a folder in my AE Structure
var theImage = w.add ("image", undefined, theImageFile);

w.center();
w.show();

 

If I add +".png" to the theImageFile in theImage i get:

Corvin0_0-1597654010690.png

Makes Sense, still I try to load footage into the UI 😉

Learn multiple ways of adding images to your scripts. Whether it be a logo or an interactive button, it is a fairly simple process! -------------------------...
Adobe Community Professional
Correct answer by Mathias Moehl | Adobe Community Professional

what about this?

var theImageFile = app.project.item(7).item(1).mainSource.file;

 Each item that refers to a footage file has a mainSource property and its file property is a file object representing the actual file on disk. Note that mainSource will be undefined it the item is a comp or solid, for example.

Topics

Error or problem, How to, Scripting, SDK, User interface or workspaces

Views

44

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Most Valuable Participant ,
Aug 17, 2020

Copy link to clipboard

Copied

I don't think this is an intendend workflow and that it will ever work. There's all sorts of loops running that keep footage items under surveillance and if nothing else it is simply containerized for safety reasons and memory management.

 

Mylenium

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Explorer ,
Aug 17, 2020

Copy link to clipboard

Copied

I was afraid so 😉

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Aug 17, 2020

Copy link to clipboard

Copied

what about this?

var theImageFile = app.project.item(7).item(1).mainSource.file;

 Each item that refers to a footage file has a mainSource property and its file property is a file object representing the actual file on disk. Note that mainSource will be undefined it the item is a comp or solid, for example.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Corvin0 LATEST
Explorer ,
Aug 17, 2020

Copy link to clipboard

Copied

Wohoo, that works, thanks Mathias!

 

A little insight on my project: I'm working on a "duell" template for sport events, elections etc. and want my UI to be built from wathever graphics a specific folder in AE contains. And the template is working with the same files in a dozen precomps to create various graphics, so I have only one master folder in AE that needs to be changed to create multiple templates/generators.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...