I replied on the slack, but you hit the basics. connect()
really needs 4 numbers:
- the node index for the first node
- the plug index for the output you want, the node index for the
- the node index for the second node
- the plug index for the second plug
In this case the API name for the multiply node’s inputs is “value” for both of them ( I think this is a change that crept into a 2016 service pack) . It means that both of the inputs report the same index, so only one of them connects with the default method. You can do it like this:
new_network.connect(vertexColorNode.outputs.rgb, mult_node.index, 0)
To get the id’s for the nodes, you need a list of the UI names for all the nodes. I got the original by just copying them down from the UI – it looks like lerp
is called “Linear Interpolate Mix”. You’d add that to the list of node names in sfxnodes.py
, then do this:
- make a dummy shader
- call
SFXNodeType.generate_class_definitions()
with the shader and the updated list of names as an argument
That should spit out the the text of all the node classes, which you should merge with the existing definitions in sfxnodes.py