Work with materials
Created by: Durman
I decided to share some thoughts about approaches to set materials to objects.
At first it looks like representation of materials should have own socket type. It is very similar to object socket type, so it can also have grey colour. I think we can use this colour for all sockets that work with Blender data.
Initially I was thinking about creating list of materials but this approach shows itself inconvenient. #1756 (closed)
I made simple node that can be named something like "material in" node.
It just creates link to existing materials in blender data. Benefits of this node is customizing material via familiar Blender interface.
Also it is easy to combine them in one list.
It is make sense to create another type of "material in" node as well that can create material with some parameters. In this way it will be not only link but also a generator of materials.
Also I made set material node.
Work of the node consists from applying materials to objects and linking material to polygons. It is possible to set as several materials to one object as one material to many objects. It is possible to assign different materials to different parts of a mesh with material index socket.
It can be integrated to Viewer Bmesh node but in this way last should have two additional sockets so this can be too much for using the node with comfort.