hey sorry for the noob question but I don’t know how to do that:
So I have script, that creates a node group and within a couple boxmasks.
That works fine, but when I run the script it should add the nodegroup to the node tree, I can add an empty node group to the tree, but not my own. (It shows up in the add menu, so this works fine as well)
Here is my code:
width_min = 0.1
width_max = 0.3
height_min = 0.05
height_max = 0.15
tree = bpy.context.scene.node_tree
def makeNodes():
nodeList = []
masksGroup = bpy.data.node_groups.new('Mask_Group', 'CompositorNodeTree')
masksOutputs = masksGroup.nodes.new('NodeGroupOutput')
masksOutputs.location = (500,0)
masksGroup.outputs.new('NodeSocketFloat','Mask')
for i in range(15):
node = masksGroup.nodes.new(type="CompositorNodeBoxMask")
node.width = round(random.uniform(width_min,width_max),2)
node.height = round(random.uniform(height_min,height_max),2)
nodeList.append(node)
linkNodes(nodeList,masksGroup)
#here is my problem "Node type Mask_Group undefined"
tree.nodes.new("Mask_Group")
return nodeList
Do you have any idea?