Writing the Textament add-on
While creating a shader can take time, we can automate some of the simpler operations. For instance, we can write an add-on to ease the task of loading images from disk and connecting them to the shader.
Using texture images
With the Texture Image node, we can use an image for coloring an object. That adds variation to how a material looks, as images can vary along the extension of an object and are not limited to a single color:
Figure 12.6: An image texture of a Rubik’s cube, applied to a plain cube
The operator that we are going to write will load multiple images from disk and guess their usage from the image’s filename. For instance, an image named Metallic.png
would be loaded as a Texture Image and connected to the Metallic input of a Principled node.
As usual, we will set up an environment for developing a new add-on.
Setting up the environment
We will create a Python script for our add-on...