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

Extracting SVG Coordinates for AE Script

New Here ,
Apr 12, 2024 Apr 12, 2024

I am needing to extract SVG coordinates for a script that I am running in After Effects. I have created an icon in illustrator, saved it as an SVG and pulled this string from it:

["M0,64.31V30.34L32.36,0l32.37,30.37v33.95H0Z"]

The script I am using is requires that the SVG coordinates be in this format:
["21.32 9.44 26.33 8.84 22.26 11.25 24.93 16.40 33.72 16.40 38.68 11.99 34 10.06 33.59 12.99 30 11.25 32.02 8.82 36.36 8.84 47 13 36 21 21 21 13 13 20 4 38 2 47 13 44.10 12.62 37.13 4.10 21.04 5.92 16.91 11.32"]

Is there anyway to get a string of coordinates from an SVG that will follow the format above?

Here is a link to the script: https://github.com/adamplouff/scriptui-battlestyle/tree/master
TOPICS
Scripting
280
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
LEGEND ,
Apr 12, 2024 Apr 12, 2024
LATEST

One are just object coordinates, the other are appear to be path points. None of this bears any relation to the other per se. Unless you expand the appearance in AI to actually get access to the paths you can't do anything with it. Conversely, the coordinates would need to be set in pixels on export, not AI's default inches and of course you may need to consider DPI, art board origin etc. To get usable values. None of this has to do with the actual coding. You need to prepare your artwork suitably.

 

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