Copy link to clipboard
Copied
Hello,
So with the current type of work I do, a lot of my workflow revolves around After Effects. I would love to be able to render individual layers or symbols to treat them independently in AE (whether it's SFX or a strange form of compositing or mapping).
Is there currently a way to do that? As it stands, I am only able to get a single still of a symbol, if it's solo-ed.
Cheers,
Rury
This may do what you want. Copy this code into a blank text file, then give it the extension JSFL.
// export selected layers of current timeline to image sequence
function main() {
var dom = fl.getDocumentDOM();
if (!dom) {
alert("ERROR: No document available.");
return;
}
var tl = dom.getTimeline();
if (!tl) {
alert("ERROR: No timeline selected.");
return;
}
var layers = tl.layers;
var sel = tl.getSelectedLayers();
var len = layers.length;
...
Copy link to clipboard
Copied
you could do that using jsfl. http://help.adobe.com/en_US/flash/cs/extend/flash_cs5_extending.pdf
Copy link to clipboard
Copied
Are you talking about a single layer in After Effects, or a single layer in Animate?
Copy link to clipboard
Copied
I wish to render out a single layer or object from Animate.
It would then be imported into After Effects afterwards.
Copy link to clipboard
Copied
see message 1.
Copy link to clipboard
Copied
This may do what you want. Copy this code into a blank text file, then give it the extension JSFL.
// export selected layers of current timeline to image sequence
function main() {
var dom = fl.getDocumentDOM();
if (!dom) {
alert("ERROR: No document available.");
return;
}
var tl = dom.getTimeline();
if (!tl) {
alert("ERROR: No timeline selected.");
return;
}
var layers = tl.layers;
var sel = tl.getSelectedLayers();
var len = layers.length;
var vis = [];
var t = 0;
var i, type;
// hide all but selected layers
for (i = 0; i < len; i++) {
type = layers.layerType;
vis.push(layers.visible);
if (i == sel
t++;
}
else if (type == "normal" || type == "guided" || type == "masked") {
layers.visible = false;
}
}
// export timeline
dom.exportPNG("", false, false);
// restore initial state
for (i = 0; i < len; i++) {
layers.visible = vis;
}
}
main();
Then double-click the JSFL file to run it against the current Animate document. Or to have it appear under the Commands menu, copy it into:
%LOCALAPPDATA%\Adobe\Animate CC 2017\en_US\Configuration\Commands
Copy link to clipboard
Copied
Dude that's AWESOME! I just tried this myself and it totally works but you have no control over which layer it exports... it only exports the top layer not the others. How would you tweak it to tell it which layer to export? Or loop through all?
Copy link to clipboard
Copied
Um, it should only be exporting the selected layers. Most of the code is dedicated to precisely that.
Did you try clicking on a different layer before running the script?
Copy link to clipboard
Copied
Nope, but then in my weak defense, you didn't say as much in your initial post... Okay cool I'll try that! Thanks dude.
Copy link to clipboard
Copied
This is great! Is there a way to modify it so that it only prints out a specified range of frames, but still only one layer?
Copy link to clipboard
Copied
yes, you can use the link in the first reply here to see how to fill in the details, but the main idea is to use
dom.exportInstanceToPNGSequence()
instead of
dom.exportPNG()