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

Include js files to the jsx script

Explorer ,
Jan 12, 2023 Jan 12, 2023

Is it possible to include the "polylabel" algorithm in the After Effects .jsx script, without using CEP panel. 

 

Link to the algorithm:

https://github.com/mapbox/polylabel

TOPICS
Expressions , Resources , Scripting , SDK
887
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 , Jan 12, 2023 Jan 12, 2023

Modern JS variants and the pretty old jsx od After Effects have some syntax differences (mostly new features not available in jsx, yet). You can be lucky that copy & paste of the js code works out of the box. Maybe you also have to tweak the code or use a system like babel.

Translate
LEGEND ,
Jan 12, 2023 Jan 12, 2023

Since it's plain JS you should have no problems just copy & pasting into whatever you want. Of course you will need to adapt variables and replace some functions with their AE functions. Not sure what more you need to know. The specifics will depend on what you actually want to do with this.

 

Mylenium 

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 ,
Jan 12, 2023 Jan 12, 2023

look at the "call nested script.jsx" file, located at "C:\Program Files\Adobe\Adobe After Effects 2022\Support Files\Scripts\(instructional)".

it shows how to include another file from a script. perhaps that would work for you.

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 ,
Jan 12, 2023 Jan 12, 2023

Modern JS variants and the pretty old jsx od After Effects have some syntax differences (mostly new features not available in jsx, yet). You can be lucky that copy & paste of the js code works out of the box. Maybe you also have to tweak the code or use a system like babel.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
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 ,
Jan 13, 2023 Jan 13, 2023
LATEST

Finding ExtendScript-ready libraries is pretty challenging these days, as ES3 is extremely old. If you need to do any advanced calculations, you'll have a much easier (and faster) time with a CEP panel.

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