Document how to use group nodes in custom node trees #80827
Maybe I'm missing something, but I could not find documentation on how to use group nodes in custom node trees. The simplest solution is probably to provide an example in the Python docs on the
bpy.types.NodeCustomGroup site. Without documenting how this is supposed to be done, we'll likely get more reports like blender/blender#76591.
@randum provided an initial script that can be used. It needs to be refined a bit more though.
Changed status from 'Needs Triage' to: 'Confirmed'
I have started implementing group nodes in Sverchok and I have got some new information which can be added into documentation.
Any addon which uses custom sockets should implement
NodeSocketInterface classes for each custom socket. Socket interface has
bl_socket_idname attribute which should keep
bl_idname of normal socket. Unlike normal sockets interface sockets should be added into
tree.outputs collections. When a socket is plugged to virtual socket of group node the node searches appropriate socket interface by their
bl_socket_idname attribute and adds it into
tree.inputs or outputs collection. The interface socket can have and draw its properties in node interface panel. According its properties sockets in group node can change their behaviour.
In documentation I have found some methods (
from_socket) which actual interface sockets does not have. Probably documentation is outdated?
>>> D.node_groups- [x].inputs bpy.data.node_groups['Sverchok group'].inputs >>> D.node_groups- [x].inputs- [x].bl_rna <bpy_struct, Struct("SvStringsSocketInterface")> >>> D.node_groups- [x].inputs- [x].init_socket Traceback (most recent call last):
File "<blender_console>", line 1, in
AttributeError: 'SvStringsSocketInterface' object has no attribute 'init_socket'
Also there is PR on Github dedicated creating UI for node groups. Probably link also can be useful.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?