A feature request for plugin development

Hello, I have developed these two plugins in Python

I know how plugins are supposed to work in Synfig, they take sif file as input and return a sif file with it’s internal data modified. And there is no way for plugin to get input from user, here’s a example for why there is need for input from user.

For the plugin I created (which centers the origin) if there would be some kind of UI for the plugins to interact with users I can get the which layers the user want to center the origin. It’s not necessary that user always wants all the layers to be operated on.

I haven’t tried but taking input from command line doesn’t seem to be a good option, think of it like what if user wants to select multiple objects. If you would not be efficient to select all the options with command line.

What do you want ?

I think if we can use webview to provide a UI for the plugin it will be great feature for plugin developers. Software like Adobe AfterEffects do this, they have a web view panel which plugin developers can use to render UI .

Why can’t you do it ?

I am still learning C++ and I don’t have much experience with it, but if someone guided me so that I can properly start making improvements to the UI of Synfig, I would definitely help.

How should we do it ?
I found this

This can implemented with gtkmm, according to them “It supports two-way JavaScript bindings (to call JavaScript from C/C++/Go and to call C/C++/Go from JavaScript).” So we can call functions from JavaScript to C++ so we don’t need to have C++ knowledge for it. If some how we make all the function call available to JavaScript then plugin will be more powerful.

Is this really necessary ?
I think it is really necessary, if Synfig allows for development of plugins which will also have control for UI then more powerful plugins can be developed, for example we can create something like Animation Nodes (doesn’t use webview) for Synfig. It will give more potential for developers.

What are other suggestions?
I don’t necessarily think webview is needed. But some way to show the UI is needed.

3 Likes

Thank you for your implication in the project :slight_smile:
As your can already use Python, I would suggest to use PyGTK
GTK is the toolkit used in Synfig, it would bring consistency and also permit you to have experience for the UI of Synfig.
After all, a language is just a kind of glue between elements :wink:
Overview — PyGObject
The Python GTK+ 3 Tutorial — Python GTK+ 3 Tutorial 3.4 documentation

1 Like

It was one of our ideas for GSoC last year :slight_smile:

I intend to play with it a bit for solving this issue [Windows] Plugins are failed to execute when Synfig started with "--console" parameter. · Issue #1569 · synfig/synfig · GitHub too.
At first, it would provide some basic access to current document only. And later, it would provide some GUI interaction.

But now I’m focused on solving the copy’n paste issues (specially skeleton’s) and a new (smaller) color editor that doesn’t pollute the undo history.

Oh, and SVG importer (minor) improvements (like avoiding memory leak and supporting ellipse shape element…)

1 Like

I think that pyGTK is the way to go for interactive scripts… But if you want a quick workaround you could just have the script modify only those objects (respectively outlines) which names start with a given character or word, and remove or not this prefix depending on some setting.

The user would then ‘simply’ need to rename the objects to be aligned, or outlines to be converted, and add, for instance, a ‘’*’’ prefix (or suffix) before calling the script.