The Addon serves mainly as a support for creating and mantaining scripted nodes. I’m making some nodes too, to show how the support works.
There is a minimal operator that converts a nodegroup into a python node. There isn’t any button for this operator and it’s only accessible through the search menu ( with the nodegroup selected, press [SPACEBAR] and search for ‘Convert Selected NodeGroup to PyNode’). The only options for now, are giving names to the bl_name, and the bl_label.
The converter’s purpose is to simplify the creation of python nodes, specially to define the reconstruction of the nodegroup in python, with all nodes, inputs, outputs and links. It will convert most of the nodegroups without any problem, but it’s not optimized and is up to the user to edit the generated code. There are also some things to consider prior to convert a nodegroup:
- remove all nodes that’s not being used. (not important but makes less code and more readability)
- remove all Frames, and any Reroute that isn’t strictly necessary.(same as above)
- the converter isn’t recursive, so no nodegroups inside nodegroups (if it’s a common function, maybe convert it to a node, else just ungroup it on your nodegroup)
- give good names to the most important nodes, so you can identify them when editing the code.
It doesn’t store the properties of the following nodes: SkyTexture, ImageTexture, EnviromentTexture, Mapping, Attribute, and perhaps one or two more. These properties are supposed to be controlled by the python node, and it’s up to the node to create an interface to control the node inside the nodegroup.
For example, if you need an Image texture inside the nodegroup, you can only expose the filepath by having a StringProperty to store the Path, a function to update the inside node whenever the string changes, and a layout.template_image() or similar in the draw_buttons() to give an interface to the path property. The Converter won’t do this, because it’s up to the creator to decide wich interface to have, if any.
If you want or you’re having troubles, send me the nodegroup you want to convert, and i’ll try to find some time to do the conversion.