If you want to create a re-usable nodegroup for texture mapping, for example this trick:
It can’t really be done cleanly. Because the image texture is needed inside the nodegroup (twice, even) with stuff going into the vector socket and the output being blended afterwards.
One solution for this is to not create a nodegroup, but and add-on which replaces an image texture node with a node group containing the same, for example like
It’s a pity the texture Image node (all texture nodes actually) actually conflates two things: Generating/loading texture data (colors) and doing the mapping. It would be nice if there would be simple ‘texture’ node which provides the color data (and has no inputs) , and a texturing node which takes a ‘texture’ input and a ‘mapping’ vector input and outputs the same as the current (Image) Texture nodes.
As a quick test I hacked the current Texture Image node to have an extra input socket where you can plug in another Texture image node to override the image data and this works like a charm. Makes texture mapping/texturing nodegroups much more reusable and simple.
My quick hack has some downsides
- it’s a quick and dirty hack, and I probably did things the wrong way. I would need to put some more research into it to do it a ‘proper’ way
- By just re-using the current Image Texture node it works only for Image Textures, and not for other textures.
- The U.I. is a bit strange, because The overridden texture info is not hidden in any way and the vector input slot of the ‘overriding’ Texture Image node is present but ignored.
Anyway, if there’s any interest in this I could post my (extremely simple ) patch. And maybe try to develop a more clean way to get a separate ‘texturing’ node as described above.