Copy link to clipboard
Copied
Hi,
When I import, from a psd file, multiple layers, the quality of each layer is really bad.
So, I open Adobe Photoshop, extract the images in a folder (png) and replace each one of them from Animate (see video).
Is there a way to script it for making Adobe Animate automatically do that ? (like jsfl but if someone could help me with the script, it would be awesome)
No problem if you don't have Illustrator.
As suggested by Chen, you can try some importing approach and hopefully your images will be replaced.
Alternatively, here is a small script to replace bitmaps from a imported PSD file.
Preview:
Usage/considerations:
- Select the folder that directly contains the imported bitmaps and run the script;
- Photoshop appends numerical indexes to layers with the same names using dashes while Animate CC uses underscores. So if one outputs to "image-1", "image-2", the o
...Copy link to clipboard
Copied
Hi.
This is possible.
But do you have Illustrator?
If you open your PSD in Illustrator and the import in Animate, I think you'll get much better results.
Copy link to clipboard
Copied
Hi,
Thanks for the answer. I don't have Illustrator. I could buy it but if you think it's possible with jsfl, maybe I could try before buying it ?
Copy link to clipboard
Copied
I don't think it's possible to solve your problem with illustrations.
Questions about replacing pictures.
Instead of swapping pictures, you can replace them when you import them.
Import Pictures First
File---Import--Import to stage.
Hint looks like sequence, whether to import sequence, point OK.
When you find that the quality of the picture is too bad.
You use Potoshop to make new pictures., export sequences
The name of the new picture sequence is the same as the name of the old sequence.
New Layer.And then again
File---Import--Import to stage.
Select a new picture sequence.
Hint looks like sequence, whether to import sequence, point OK.
You will then be prompted to replace the existing item. Select it.
This time your original layer picture is all replaced.
And then you delete the new layer,
Now, the picture in your layer is all new.
Of course, if the number of sequence pictures is not equal.
You need to delete 1-2 frames.
Copy link to clipboard
Copied
In fact, it feels like you don't have to set the steps you should follow.
If you have used a bitmap, then the steps.
You should only draw lines in Potoshop.
After importing ANCC,
Using bitmaps to convert to vectors.
Turn the line into a vector line.Then smooth it.
Then fill the color on the ANCC.
And everything should be done in a graphic component or movie clip.
Of course, if the general animation, you should take the picture as a draft. Then redraw in ANCC. This is the step of the animation.
Copy link to clipboard
Copied
No problem if you don't have Illustrator.
As suggested by Chen, you can try some importing approach and hopefully your images will be replaced.
Alternatively, here is a small script to replace bitmaps from a imported PSD file.
Preview:
Usage/considerations:
- Select the folder that directly contains the imported bitmaps and run the script;
- Photoshop appends numerical indexes to layers with the same names using dashes while Animate CC uses underscores. So if one outputs to "image-1", "image-2", the other outputs "image_1", "image_2". So, for these cases, the images won't be replaced.
Swap External Images JSFL script download:
Swap External Bitmaps.jsfl - Google Drive
JSFL code for reference only. Feel free to fix and/or optimize if needed:
var uri;
function importImages()
{
var doc = fl.getDocumentDOM();
var lib;
var libFolder;
if (!doc)
return;
lib = doc.library;
libFolder = lib.getSelectedItems()[0].name;
if (!libFolder)
return;
try
{
var externalBitmaps = getExternalBitmaps();
var path;
var newName;
if (!externalBitmaps)
return;
for (var i = 0, total = externalBitmaps.length; i < total; i++)
{
var path = uri + "/" + externalBitmaps;
var newName = externalBitmaps.replace(".png", "");
doc.importFile(path, true, false, false);
lib.selectItem(externalBitmaps);
lib.renameItem(newName);
lib.moveToFolder(libFolder, newName, true);
}
}
catch(error)
{
fl.trace(externalBitmaps);
fl.trace(error);
fl.trace("___________");
}
}
function getExternalBitmaps()
{
uri = fl.browseForFolderURL("select", "Select the folder containing the PNGs.");
return FLfile.listFolder(uri + "/*.png", "Images.");
}
importImages();
I hope this helps.
Regards,
JC
Copy link to clipboard
Copied
Exactly that !!!
Thank you very much !
Copy link to clipboard
Copied
Excellent!
You're welcome!
Copy link to clipboard
Copied
How to import a PSD:
Copy link to clipboard
Copied
locked