These are the same as the old scripts, they show a menu entry in the plugins menu, and get executed when the user clicks them. That part hasn’t changed.
Now the plugin can define how standard output / standard error is handled, just add stout or stderr to , they support the following values:
ignore - the output is discarded
log - the output is shown in the synfig log
message - if there is any output, it’s displayed in a dialog
The default is to ignore stdout and message for stderr
Exporters
Plugin can now define exporters, which will be shown in the new Export dialog (under File).
Basically you define the filter to show in the dialog, and the script to run when the user selects a specific file type to export to.
The built in Lottie plugin now uses this system.
Importers
Similar to exporters but to load from various formats.
if "<layer " in line:
inputfile_f.write(line.replace(' active="false" ',' active="true" '))
Please don’t do this in a tutorial! It’s teaching bad practice. XML files can’t reliably be parsed as ordinary text files, and this will break badly if valid output has even a slight change of form– which doesn’t even need a change in Synfig. Imagine if a new version of Synfig, or even a different extension, added another attribute to “layer”, which made the XML serialiser decide to move the “active” attribute to the end of the tag, for example.
It should be using something like sangfroid or Beautiful Soup, or if you’re only relying on out-of-the-box libraries. xml.sax or xml.dom.