I have created some custom node groups that use built-in nodes in Cycles Compositor. Now I would like to have another group that make use of these custom groups. I think in the new node group, I would do something similar to

Mygroupnode = nodes.new('somegroupname')

However, what I got is an error saying there was no type called 'somegroupname'. I understand that the position is expected to receive a node type (not name), but I don't know how to retrieve a type of my group node.

PS: There is a type called 'CompositorNodeGroup', but it can only create an 'empty' node where you should do an extra step to link it to a custom group node. But I do not know how to do it in script.


This is done by adding a node group:

group = C.scene.node_tree.nodes.new('CompositorNodeGroup')

... and then adding the custom group as new group's node tree:

group.node_tree = bpy.data.node_groups['somegroupname']

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.