There are certain nodes within cycles that dont have inputs for some values.
For example on the colour ramp node - the position input box for a particular colour tag on the colour ramp.
You can however right click this and add a driver so that this value can be animated.
My question is - is there any way this driver can be linked to a cycles node (e.g. a value input node) so that it can be exposed to a node group input?
For animations it works, because the value only changes between frames. But as something you can put in a socket, it won’t work. Those variables stay constant in the nodetree during the whole frame render.
Yep - I don’t want the value to change - I just want to expose it to group input slots. It’s easier to change the value of a group input value - than to have to open up the node tree and modify the value in the colour ramp itself.
Then it’s possible with python nodes.
It won’t be a socket, but you can draw the interface of some node on the outside of the nodetree (for example, with the color ramp template)
i’m testing it now… unfortunatly changes to the color ramp through the interface are not updated automatically…
here what I have so far (you’ll need my addon for this):
make the nodegroup with the color ramp inside
with the nodegroup selected (not opened), press ‘SPACE’ and look for ‘Convert Nodegroup to PyNode’
give it a bl_name and a bl_label and press OK.
In the text editor, edit the scripted node (it’s in the addons folder, ‘\ShaderNodesExtra\Nodes’), change the line:
#def draw_buttons(self, context, layout):
to
def draw_buttons(self, context, layout):
layout.template_color_ramp(self.node_tree.nodes[name of the colorramp node], 'color_ramp')
save the file, restart blender, and it should be working (look in the ‘custom nodes’ on add menu)
For updating, you can put ‘context.space_data.edit_tree.update_tag()’ above the ‘layout.template_color_ramp(…)’ line. It’s not the best approach but it works.