Copy link to clipboard
Copied
Hello,
Does anyone know a way I can export my layers in Adobe Animate as seperate PNG. For example in Photoshop I can use Layers to Files. A batch export. I need a way to do this.
Copy link to clipboard
Copied
1. you can set your publish settings (file>publish settings) to not include hidden layers.
2. hide all layers.
3. unhide the layer you want to export
4. export
repeat 3 and 4 as needed.
and for automation, you can use a jsfl file to do this.
Copy link to clipboard
Copied
Hello,
I can't seem to get the publish settings to export the layers as full size images of the canvas size. Unless I am doing something wrong. I assume I would need "image assets" but nothing publishes other than an empty folder. I don't want a sprite sheet. I just want the layer as is with the dimension of the canvas.
Where can I find a JSFL to do this?
Copy link to clipboard
Copied
I think @sergiopop75 had a JSFL command for this. Can you help Sergio?
Copy link to clipboard
Copied
Mario, thanks for the reference, it makes me feel important, 😂!
There is a Shane McCartney code:
var doc = fl.getDocumentDOM();
var lyrs = doc.getTimeline().layers;
var len = lyrs.length;
var lyr;
var originalType;
var i;
var saveDir = fl.browseForFolderURL("Choose a folder in which to save your exported SWFs:");
var layers = new Array();
var count = 0 ;
//create folder with the file name//
var docfoldername = doc.name ;
var numberOrNot = docfoldername.slice (17,18) ;
if ( numberOrNot == "0" || numberOrNot == "1" || numberOrNot == "2" || numberOrNot == "3" || numberOrNot == "4" || numberOrNot == "5" || numberOrNot == "6" || numberOrNot == "7" || numberOrNot == "8" || numberOrNot == "9" )
{
var exportDest = saveDir+ "/" + docfoldername.slice (0,18)+"_PNG"
}else{
var exportDest = saveDir+ "/" + docfoldername.slice (0,17)+"_PNG"
}
FLfile.createFolder(exportDest);
if (saveDir) {
fl.outputPanel.clear();
var originalTypes = new Array();
for (i=0; i < len; i++) {
lyr = lyrs[i];
originalTypes[i] = lyr.layerType;
};
for (i=0; i < len; i++) {
lyr = lyrs[i];
lyr.layerType = "guide";
};
for (i=0; i < len; i++) {
lyr = lyrs[i];
originalType = originalTypes[i]
if (originalType == "normal" && lyr.visible == true) {
lyr.layerType = "normal";
// padding 0s
if (count<10){
var padding = "0"+count
}else{
var padding = count
}
doc.exportPNG(exportDest +"/" + padding + "_"+lyr.name+".png", true);
fl.trace("Exported: " + lyr.name+".png");
lyr.layerType = "guide";
count += 1;
}
};
for (i=0; i < len; i++) {
lyr = lyrs[i];
lyr.layerType = originalTypes[i];
};
}
Copy link to clipboard
Copied
before you answer a bunch of questions helping the op to implement that code, you should address: "I can't seem to get the publish settings to export the layers as full size images of the canvas size."
i think the op is under the impression that using jsfl will "solve" this.
Copy link to clipboard
Copied
Hello, this is a very useful script, thank you!
I am having an issue where the script is generating about 70 extra empty pngs between keyframes,
On a test file with default settings; get about 3 empty pngs between frames.
Ever experience this issue before? It's something at the file level.
Copy link to clipboard
Copied
Do you have any empty layers?
Copy link to clipboard
Copied
does following steps 1 to 4, export your layer as an image (with its size unchanged from the graphic on-stage in that layer)?
Copy link to clipboard
Copied
It's a little bit of a round about approach, but you could publish SWFs, import those into an After Effects project, and then use File > Save Frame As... > Photoshop Layers to get to your Animate artwork over to Photoshop.
Working with Adobe Premiere Pro and After Effects
https://helpx.adobe.com/animate/using/premiere-pro-effects.html
Scroll down to Importing SWF files into After Effects.