Learning Blender 3D multiple materials (optional)
As discussed in the previous section of this Learning Blender 3D tutorial series on making and applying materials to meshes, although multiple materials are not required whilst making the tutorial chair, it is useful to go over at this subject whilst we're already discussing 'materials' in general.
Much of the set-up and use of multiple materials on meshes and models is the same as with single materials in that each separate material is composed of the same core elements - "Material", "Texture" and "Image". Where they differ is in how they are physically applied, so that's largely what this following section will cover.
Assigning materials to faces ^
When using multiple materials on the same mesh object, each individual material has to be physically assigned to the polygons and faces it's should affect. This means that much of the application of materials (and making of can and) is done in "Edit" mode. So, as the mesh already has a single material applied from the previous section of this tutorial we need to make sure that it's assigned to all surfaces of the mesh.
Select the object and if not already selected and press "Tab" to enter "Edit" mode; if the "Material" panel isn't visible after doing this click the sphere icon in the Properties Header. Looking at the now available options, on further inspection there should be a new set of buttons - "Assign", "Select" and "Deselect" - these are material assignment and management buttons that allow individual materials to be assigned to different faces or sections of an mesh.
What we need to do at this point is select the material from the list, select all faces of the mesh ("A") and then click the "Assign" button to apply the "chair" material to everything (shown below).
Multiple material buttons. 1) the "Assign" button attaches selected material to a mesh or selection of faces [see *.blend "13c"]
Making a new material ^
Next, a new material needs to be made and applied to other selected areas of the mesh. Still in Edit mode, click the "+" (plus) button to the right of the material list, creating a duplicate or copy of the original material. This now means there are two instances of that original material, indicated by the duplicate name in the material list, which now shows two entries named "chair", and by the presence of the number "2" to the left of the datablock name (shown below).
Making a new material by copy/duplicating the default. 1) Material list showing original and duplicate material. 2) The "+" button is used to create a new version or duplicate of the original material. 3) The new duplicated material datablock name "chair" [see *.blend "13d"]
The new duplicate then needs to be converted into a 'unique' material so only a single instance of it and the original exist, both then being what are commonly referred to as "single user" datablock's in Blender.
Design note: a "datablock" in Blender is simply the name given to a segment of information that can be used on its own, a "single user", or several times, a "multi-user", meaning the more than one item or object is using the information associated with that "datablock", a texture used by several materials for example.
To do this, make sure the duplicate is selected in the material list (LMB select), then click the "+" button to the right of the materials datablock name (not the "+" to the right of the material list as was done above). Blender will then convert the material and append an incremental number, starting with ".001", to the datablock, making it unique - the material list window and the datablock name will update to reflect this change, renaming the material datablock to "chair.001" which is displayed in both the material list and the material datablock name field below it, as shown below.
Making duplicate materials 'unique'. 1) New material auto-named as a result of being made 'unique'. 2) The "+" button creates a new 'user' making the material unique ('single user'). 3) Material datablock name showing the default automatically named "chair.001" [see *.blend "14"]
This new single user material can then be renamed in exactly the same way as was done with the original by amending the text in the datablock input field, in this instance to "back" (shown below).
Design note: it's best to rename these auto-named blocks because the appended ".001" etc, can cause problems if meshes are exported to other formats for use outside of Blender.
Renaming one of the multiple materials. 1) Material list showing the original material and the renamed material. 3) The material datablock renamed to "back"
Addendum: Adding new Materials in Blender 2.57+ or above ^
A major change introduced to Blender 2.57+, and carried forward into newer versions, in the way materials are managed means we need to modify what we do when adding new slots. Instead of a new material being a duplicate of a previous datablock (set of parameters), in newer versions of Blender all this does is create a 'blank' entry in the Material list - it has no default properties of any kind assigned by default. To fix this click the "+" button top-right of the Material List view and create the necessary new entry, as mentioned a 'blank' slot will appear. This then needs to be made 'unique' (single user) so it has it's own associated properties. To do make sure the new entry is selected in the Materials List and then click the "+ New" button, this 'converts' the reference into full Material with a default set of properties that can be assigned to the mesh as per below.
Click the "+" button to add a new material, this creates a completely blank material slot, it's neither a full material nor does it have any associated properties - at the moment it's simply a data reference. Click the "+ New" button, this will 'convert' the reference to a fully independent (single-user) and named material, with it's own set of default options [see *.blend "13-257a"]
The entry in the Material list changes to reflect the change in 'state' of the original 'reference' once it's been 'converted' into a proper Material. A set of default properties are now available. 1) Material ID datablock - name can be changed. 4) Once the material has some 'properties' it can be assigned to the mesh
Once the material slot is set up properly it can then be assigned to the object by selecting various elements and clicking the "Assign" button - note the "Diffuse" colour has been changed to make the material and where it's assigned more visible (shown in green to distinguish from previous instruction). 4) Material List entries showing the new material colour sample
Assigning multiple materials ^
Once the basic parameters have been set, the material can be assigned to the mesh. Select a collection of faces (border, circle or Shift+RMB select), make sure the material is active in the material list ("back") and then below that, click the "Assign" button to assign it to the mesh. The result of doing this won't be visible just yet because both the new and original material currently use the same "Diffuse" colour - one or the other will need to be changed by selecting a new colour from the colour wheel, the changes then show on the mesh distinguishing each individual material assignment (as shown below).
Design note: multiple materials are useful for managing the modeling process because mesh sections can be shown or hidden based on material assignment
Changing the new materials diffuse colour to make it more visible. 1) Material list showing active materials. 2) Material assignment button appear on entering Edit mode. 4) Changing the materials "Diffuse" colour to make it distinguishable from the other material applied to the mesh. 5) Selecting the diffuse "colour" using the colour selector (which appears after clicking the diffuse colour sample)
Second material assigned to the mesh in Edit mode. Faces are selected and the new material assigned by clicking the "Assign" button [see *.blend "15"]
Multiple materials and textures stages ^
Although the two material stages are now independent, the 'texture' and 'image' information (datablock's) associated with each is still the same, so in a similar way to the process described above, both of these references can be converted into 'single users', allowing for the assignment of different texture and image data to each material and making them both 'unique'.
Right now the materials look like the following;
Blue & Yellow material.
Instead of what's needed; two sets of independent materials each composed of separate "Material", "Texture" and "Image" slots, as follows;
Original texture stage with multiple users. 1) Available and used texture slots available in this stage of the overall materials set-up. 2) Texture datablock name. 3) The "+" button makes a 'single user' texture when there are more than one reference being made to a texture
Editing and managing texture and image based material settings is done in the "Texture Properties" panel, so click the "Texture" button in the Properties Header (has a 'checker' on it) to open the appropriate options. To make the texture data 'unique' click the button numbered "2" or the "+" button to the right of that, this will create a 'unique' texture by duplicating the original, auto-renaming it "Tex.001" - where ".001" is an incremental number and "Tex" is a duplication of the original texture data so it uses the same 'name' (bottom image below).
This newly created single user texture datablock ("Tex.001") can then be renamed by amending the text in the datablock input field, in this instance to "back", completing the creation of a separate 'texture slot' for the previously created material. This now means that both the blue and yellow materials use independent texture slots. Next, a separate image has to be assigned to the new texture slot.
Making 'unique' texture stages from a multi-user datablock. 1) Texture slot list showing the newly created unique texture. 2) The texture datablock automatically named "Tex.001". 3) The "+" button creates a unique user from a duplicate. 4) Renaming the new unique texture to "back". 5) Texture list showing the newly created texture
Multiple texture stages and images ^
At this point there are two separate material slots referencing two independent texture slots that still use the same physical image. This needs to be changed so that, as before, there are two unique image 'users' with their associated bitmaps.
Continuing on from previous, scroll down the "Texture Properties" options to the "Image" section and instead of clicking the "+" button as we've done before, click the 'folder icon' to the right of the datablock name to open the "File Browser". Select an image - check whether the source material should use "Relative Path" - then click the "Open" button to load the file. Doing this will automatically create a new single user image slot, so the "2" will disappear and the text associated with the datablock will display the name of the new image just loaded, "WOODgreen.tga". The "Preview" pane will also update to show a visual sample of the image - a 'green' tinted wood texture in this particular instance.
Loading in a new image. 1) Image datablock name. 2) File Browser button used to load in a new replacement image
Loading a new image into the previously created texture slot for the additional material
A 'single user' slot loaded into the previously created single user texture slot. 1) Image datablock name showing the image file "WOODgreen.tga". 2) File Browser button to load in a new image. 3) New image loaded into the "Image" slot of the "Texture" [see *.blend "17"]
To check the overall material has been set up correctly, view the "Material" properties options, there should be two entries in the material list, "chair" and "back", the selection of which should change the preview sphere to reflect the different images associated with the individual texture stages of each unique material. There are now two materials each has separate "Material", "Texture" and "Image" slots.
Final materials, textures and images listed, all set as unique (single) users. 1) Material list showing the now two unique (single user) materials (with texture/image preview). 2) Material datablock names associated with each material. 3) Diffuse colours assigned to each material. 4) Preview of the separate texture images associated with each material [see *.blend "18"]
Shown for reference, the separate textures assigned to their respective sections of the UVW map [see *.blend "18b"]
Addendum: Adding new Texture slots in 2.57+ or above ^
The change to the material system introduced with Blender 2.57, and carried into later versions, also means we need to modify how "Texture" slots are made. On creating a new "Material" (see previous), it's linked to a corresponding "Texture" slot. At this point, this is simply a 'connection' between the two so we know we're editing the correct 'material/texture' matching pairs. As this is just a 'link' it also means the slot contains no "Properties" or texture data, so we'll need to add those in order to then load in an image and edit various settings (as needed).
To add a new texture click the "+ New" button (first image below). This creates the necessary slot and populates it with "Clouds" as the default texture 'type' (second image below') which we can now edit. Click the "Type:" drop-down (third image below) and select "Image or Movie" from the list which will then activate the "Preview" pane and "Image" sub-sections. To complete the texture set up scroll down to and in the "Image" sub-section click "Open" to load an image - in the File Browser (fourth below), select the file, set "Relative Path" and then click "Open Image" to load the file into the texture slot. The Preview pane and Image properties sections will update to show the new asset and file information.
Although any previously created 'new' material now has "Material" properties, its "Texture" properties are blank[1,3]; they have to be added by clicking the "+ New" button... [see *.blend "13-257b"]
...which creates a unique (single-user) slot named "Texture" (shown in the texture slot list). This also creates a set of associated properties that default to "Type: Clouds"
With the new properties added select "Image or Movie" from the "Type:" list to activate the textures "Image" properties and click the "Open" button
In the File Browser select the image to load and make sure "Relative Path" is set. 1) click "Open Image" to load asset. 2) select the letter corresponding to your hard drive and select files/folders
Once an additional image has been selected and loaded the "Image" properties will update appropriately to show preview and file information[1,2]. 4) material applied to the mesh. 5) original material assignment
Final 'multiple' Materials showing the Material List entries, Material ID blocks where the name can be changed is required, the "Diffuse" property where the colour can be changed, and the assignment button to apply materials to the mesh (selections)
Using additional materials ^
Setting up more materials uses the same principle of duplicating an original global material, assigning that to the respective faces or a mesh and then changing the data associated with the material so it's using unique or single users per stage; if using separate images you should always end up with a set of "Material", "Texture" and "Image" stages to the complete global material.
With Blender 2.57 and beyond (including the latest versions) however, multiple materials have to be thought about in a slightly different way because by default, each new entry is 'unique' rather than being a duplication of a slot that already exists. If duplication is required, once the new material has been set up it can be given the same properties associated with other materials by either manually setting them or selecting a previous entry from the "Browse Material to be Linked" property (the sphere to the left of "Material ID" input field) - simply LMB select the material to be changed from the "Material List", click the 'sphere' and select the appropriate datablock. The material will update with the new settings whilst maintaining it's 'unique' status (it's still usable as an independent material).
Select the MAterial to be changed and click the 'Sphere' button to open the "Browse Material to be Linked" data list. Click a previously entry. This assigns that datablock to the selected material in the Material List which will then update the material and any assignments on the mesh [see *.blend "13-257c"]
Note that in assigning different material data, the currently selected material (the one being assigned duplicate data) changes to reflect the chosen datablock. This changes material 'data' only as the Material itself is still unique so can be assigned and selected individually using the "Assign", "Select" and "Deselect"