Support for loading meta-operations from .json now in master
Hi,
a long standing enhancement[1] in GEGL has been to allow loading
meta-operations from a serializable file instead of requiring them to be
coded in C.
At 31c3 I started working on this, and yesterday it reached a generally
working state. Today I merged the code to master[2].
Each .json file of right format that is found in the module path for GEGL
will create a new GeglOperationMeta subclass. It will be register it with
the specified operation name, and exported properties/pads.
When the operation is instantiated, it builds up the subgraph of GeglNodes
specified and connects. Property changes on the meta-operation are
forwarded onto the real node inside.
An example of the .json format can be seen here:
https://git.gnome.org/browse/gegl/tree/operations/json/grey2.json
This is a format also used by other dataflow/flow-based-programming
tools[3].
This for instance allows one to use the node-based editor Flowhub+imgflo to
build a new image filter, save it as .json and then use it in GIMP[4]
(screenshot). One can of course also hand-write the json files, or
implement other editors for these.
It might make sense to also implement serialization of a graph/sub-graph to
this format directly in GEGL itself.
Note: This adds json-glib 1.0 as a dependency of GEGL, so make sure you
have it installed (including development headers).
References
1. https://bugzilla.gnome.org/show_bug.cgi?id=465743
2.
https://git.gnome.org/browse/gegl/commit/?id=564f45bad76eb0f888e628ea70345912dd68cbbb
3. http://noflojs.org/documentation/json
4. https://twitter.com/jononor/status/557570481206099969
Jon Nordby - www.jonnor.com