Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

Searching a way for Animate to automatically replace each images with other ones

Contributor ,
Jun 15, 2018 Jun 15, 2018

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).

Capturer 21 - Streamable

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)

2.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 15, 2018 Jun 15, 2018

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:

animate_cc_jsfl_swap_external_bitmaps.gif

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

...
Translate
Community Expert ,
Jun 15, 2018 Jun 15, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 15, 2018 Jun 15, 2018

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 ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 15, 2018 Jun 15, 2018

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.

tihuan.gif

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 15, 2018 Jun 15, 2018

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.

tupian.gif

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 15, 2018 Jun 15, 2018

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:

animate_cc_jsfl_swap_external_bitmaps.gif

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 15, 2018 Jun 15, 2018

Exactly that !!!

Thank you very much !

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 16, 2018 Jun 16, 2018

Excellent!

You're welcome!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 11, 2023 Apr 11, 2023

How to import a PSD:

 

Captura de pantalla 2023-04-11 a las 14.08.57.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 11, 2023 Apr 11, 2023
LATEST

locked

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