Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Import SVG to JSON??
#2
Hi,

The JSON format Curvy uses is a JSON based format that I made up for usage only inside Curvy, to share splines easily between different users, or to save/load them at runtime, or even as a way to batch process splines in the text format. So it's not a format that was made to be compatible with external tools as Adobe Illustrator. This being said, I tried to make it as easy as possible for any user to make Curvy compatible with any other JSON based format:

If you go to Curvy\ImportExport\Wrappers.cs, you will see two classes that represent the JSON equivalents of CurvySpline (namely SerializedCurvySpline) and CurvySplineSegement (namely SerializedCurvySplineSegment). By renaming, adding or removing fields in these classes, you control what Curvy seeks when reading or writing JSON files.

Curvy expects a file that is an array of splines. Your file is an array of layers, which in turn are arrays of splines. So you will have to handle this difference either at the file level (by putting all the splines at the same layer) or at the code level (by modifying Curvy's code reading the JSON files to add the notion of layers, in Curvy\Base\Editor\Wizards\ImportExportWizard.cs)

I know I dumped a lot of information here, so don't hesitate if you need me to explain further some point that might be not clear.

I hope this helped.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Messages In This Thread
Import SVG to JSON?? - by Saurabh - 11-04-2018, 04:21 PM
RE: Import SVG to JSON?? - by _Aka_ - 11-04-2018, 08:36 PM
RE: Import SVG to JSON?? - by Saurabh - 11-12-2018, 02:49 PM
RE: Import SVG to JSON?? - by Saurabh - 11-13-2018, 08:38 AM
RE: Import SVG to JSON?? - by _Aka_ - 11-13-2018, 11:34 AM
RE: Import SVG to JSON?? - by Saurabh - 11-14-2018, 09:07 AM
RE: Import SVG to JSON?? - by _Aka_ - 11-14-2018, 10:21 AM
RE: Import SVG to JSON?? - by Saurabh - 11-14-2018, 01:41 PM
RE: Import SVG to JSON?? - by _Aka_ - 11-15-2018, 10:55 AM
RE: Import SVG to JSON?? - by Saurabh - 11-15-2018, 08:22 PM
RE: Import SVG to JSON?? - by _Aka_ - 11-15-2018, 08:39 PM
RE: Import SVG to JSON?? - by Pixel Flipper - 09-11-2019, 03:05 PM
RE: Import SVG to JSON?? - by _Aka_ - 09-11-2019, 10:17 PM
RE: Import SVG to JSON?? - by Pixel Flipper - 09-12-2019, 07:32 AM
RE: Import SVG to JSON?? - by _Aka_ - 09-12-2019, 10:53 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Import/Export, Spline from code Mos Def 4 783 02-14-2022, 11:42 AM
Last Post: _Aka_
  Import splines from GeoJson Qpid36 4 4,084 11-22-2019, 03:45 PM
Last Post: _Aka_
  3ds max import? turbo 9 11,956 09-16-2019, 01:36 PM
Last Post: _Aka_
  Unable to import in 2018.4.2 LTS unity romit99 1 2,192 06-25-2019, 11:56 AM
Last Post: _Aka_

Forum Jump: