Chair – Multiple Materials (#5)

Spread the love

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.

Download: KatsBits – Chair Source (c. 7 MB | *.blend, *.tga).

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[1] – "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

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[2], creating a duplicate or copy of the original material[1]. This now means there are two instances of that original material, indicated by the duplicate name in the material list[1], which now shows two entries named "chair", and by the presence of the number "2" to the left of the datablock name[3] (shown below).

Making a new material by copy/duplicating the default

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[1] (LMB select), then click the "+" button[2] to the right of the materials datablock name[3] (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[3] to "chair.001" which is displayed in both the material list[1] and the material datablock name field below it[3], as shown below.

Making duplicate materials 'unique'

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[3], 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

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[4]. To fix this click the "+" button top-right of the Material List view[1] and create the necessary new entry, as mentioned a ‘blank’ slot will appear[2]. 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[3], this ‘converts’ the reference into full Material with a default set of properties that can be assigned to the mesh as per below.

Adding a new Material slot

Click the "+" button[1] to add a new material, this creates a completely blank material slot[2], it’s neither a full material nor does it have any associated properties[4] – at the moment it’s simply a data reference. Click the "+ New"[3] 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"]

Making the new material slot 'unique' with it's own properties

The entry in the Material list changes to reflect the change in ‘state’ of the original ‘reference’ once it’s been ‘converted’[1] into a proper Material[2]. A set of default properties are now available[3]. 1) Material ID datablock – name can be changed. 4) Once the material has some ‘properties’ it can be assigned to the mesh

Assigning the completed material to the mesh with "Assign"

Once the material slot is set up properly it can then be assigned to the object by selecting various elements[2] and clicking the "Assign" button[1] – note the "Diffuse" colour[3] 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")[1] and then below that, click the "Assign" button[2] 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[4] by selecting a new colour from the colour wheel[5], 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

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

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[1], so in a similar way to the process described above, both of these references can be converted into ‘single users[3], 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.
    • Material.
    • Texture.
    • Image.

Instead of what’s needed; two sets of independent materials each composed of separate "Material", "Texture" and "Image" slots, as follows;

  • Blue material.

    • Material.
    • Texture.
    • Image.
  • Yellow material.

    • Material.
    • Texture.
    • Image.
Original texture stage with multiple users

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[3], this will create a ‘unique’ texture by duplicating the original, auto-renaming it "Tex.001"[1] – 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[4], in this instance to "back"[5], 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

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[1][2]. 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[1] and instead of clicking the "+" button as we’ve done before, click the ‘folder icon‘ to the right of the datablock name[2] 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[2] and the text associated with the datablock will display the name of the new image just loaded, "WOODgreen.tga"[1]. The "Preview" pane will also update to show a visual sample of the image – a ‘green’ tinted wood texture[3] in this particular instance.

Loading in a new image

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

Loading a new image into the previously created texture slot for the additional material

A single user slot loaded into the newly created single user texture slot

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[1], "chair" and "back"[2], the selection of which should change the preview sphere to reflect the different images associated with the individual texture stages of each unique material[4]. There are now two materials each has separate "Material", "Texture" and "Image" slots.

Final materials, textures and images all set as unique (single) users

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"]

The result - each texture assigned to its respective section of the objects UVW map

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[1]. 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[3], 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[2] (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[2] (third image below) and select "Image or Movie"[2] 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.

New material has a 'blank' texture slot (no settings)

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[2][see *.blend "13-257b"]

Adding a new Texture slot creates a set of default properties

…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"

Changing the default properties to "Image or Movie"

With the new properties added[1] select "Image or Movie"[2] from the "Type:" list to activate the textures "Image" properties and click the "Open" button[3]

Browse and select and image bitmap to load into the material

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

Bitmap opened into the Texture slot showing the associated properties

Once an additional image has been selected and loaded the "Image" properties will update appropriately to show preview[3] and file information[1,2]. 4) material applied to the mesh. 5) original material assignment

Final Material set-up

Final ‘multiple’ Materials showing the Material List entries[1], Material ID blocks[3] where the name can be changed is required, the "Diffuse" property[4] where the colour can be changed, and the assignment button[2] 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"[2] property (the sphere to the left of "Material ID"[2] input field) – simply LMB select the material to be changed from the "Material List"[1], 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).

Assigning 'duplicate' data to new material

Select the MAterial to be changed and click the ‘Sphere’ button[2] 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[1] which will then update the material and any assignments on the mesh [see *.blend "13-257c"]

Duplicate data assigned to material

Note that in assigning different material data, the currently selected material (the one being assigned duplicate data) changes to reflect the chosen datablock[1]. This changes material ‘data’ only[2] as the Material itself[4] is still unique so can be assigned and selected individually using the "Assign", "Select" and "Deselect"[3]

Spread the love