Can't create Output sockets for a NodeGroupInput, bug?

I was updating from 2.66 to 2.68 an importer that loads models with cycles materials and creates node groups.

I could update everything find reading the release notes, wiki and this bug report, but what I can’t figure out is why you can’t create node sockets (outputs) for a nodegroupInput unless you create a link to something first.


  1. Manually you can’t create an output unless you link it to something

  1. Once you created a link, you can create as many new outputs as you want in the N panel.

So this looks to me to a limitation both in python and in the UI compared to the old way node groups worked.
This code should create a nodeGroupInput with all the sockets(outputs) I want but it doesn’t, and it doesn’t give any warnings either. It just creates a Group input without any socket/outputs:

import bpy

NodeGroup="GroupTest", type='ShaderNodeTree')

Input_group ="NodeGroupInput")'RGBA', "Tex Diffuse")'RGBA', "Tex Specular")'RGBA', "Tex Normal")

Can someone confirm this looks like a bug?
This is something important for scripts since you want to create only one group with their inputs but they might not be used always in all materials.

I wrote a group node writer a while ago and this was the way i handled inputs / outputs

import bpy

x ="rayTransparency","ShaderNodeTree")
ngo ="NodeGroupOutput")
ngi ="NodeGroupInput")

mth ="ShaderNodeMath")[0],ngi.outputs[0])[0],ngo.inputs[0])
x.inputs[0].name = "Transparency"
x.inputs[0].default_value = 1

Pretty much you cant just hit create new for some strange reason in python… you have to link it to a socket then rename.

Yeah, that’s my point, in the previous way of creating nodes by python was much convenient. I couldn’t find any discussion about this though.

maybe submit it as a bug to the bug tracker?

Yeah, I think I will because in this case in 2.67 when the node groups were overhauled this counts like a broken features. But any other opinion before submitting will be good

is this a bug ?

i think there are other bug also for some other method to access I/O
but will avhe to see it it is corrected
right now only way i was able to do it was with index method
other 2 methods did nto work!


Well, I opened a bug and Lukas pointed me in the right direction thankfully.
Turns out you don’t have to reference the Input group node, but group.inputs, as in 2.67.

can you show update example


Ricky, Lucas posted this:

import bpy
TestGroup ="Test", type='ShaderNodeTree')
Input_node ="NodeGroupInput")

# Use the nodetree.inputs/outputs collections for extending the node group interface'NodeSocketColor', "Tex Diffuse")'NodeSocketColor', "Tex Specular")