Python API: add Python-defined node groups for shaders and compositing.

This was already supported for Cycles shader nodes, but now also works for
Eevee and compositing nodes. Instead of a generic NodeCustomGroup, now
there is ShaderNodeCustomGroup and CompositorNodeCustomGroup that can be
subclassed and registered.

Differential Revision: https://developer.blender.org/D4370
This commit is contained in:
Miguel Porces
2019-03-16 18:48:22 +01:00
committed by Brecht Van Lommel
parent 5797a5fc65
commit 9e152f919f
17 changed files with 107 additions and 24 deletions

View File

@@ -99,7 +99,9 @@ def node_group_items(context):
# filter out recursive groups
if contains_group(group, ntree):
continue
# filter out hidden nodetrees
if group.name.startswith('.'):
continue
yield NodeItem(node_tree_group_type[group.bl_idname],
group.name,
{"node_tree": "bpy.data.node_groups[%r]" % group.name})