In the past I’ve used boost::python to embed scripts in my applications, it has a smart system to link C++ classes and objects to the python scripts allowing for communication between the python script and the C++ app.
For importing files, probably the best option though is just to have the script to generate the sif xml as a string or a temporary file.
Linking the plugin with an open file dialog shouldn’t be too hard as long as there’s a way to add metadata to the plugin that tells which file extensions it can load.
In perfect case it would be nice to have some GUI settings for import/export (i.e for Lottie export we might want some options at some point).
In simplest implementation it is possible to write a synfig-core module in C++ (like mod_svg linked above), which calls a Python script. For having GUI options it will require to add code into synfig-studio, which actually interferes with a concept of “module in synfig-core”.
So, it’s best to think how to organize import/export (conversion) routines in synfig-studio (synfig-core doesn’t needs it anyway).
btw, does the sif file format support specifying bezier tangents in cartesian coordinates?
Currently I’m converting them from cartesian (the way they are stored in lottie) to polar, but that creates some artefacts on animated regions, when the value from one waypoint is close to 180 degrees and the value on the next waypoint becomes -180, making that tangent spin around like crazy.
Another update, I’ve added support for approximating easing values.
I also have experimented with inkscape extensions, looks like for import/export they have an XML which defines the UI for a dialog where you can define extra options for the file format, then passes them to a script on the command line, for both import and export the script is given a file name on the command line and outputs the result to stdout.