From BlenderWiki

Jump to: navigation, search

Multiple Materials

We normally think of an object as having a single material; a color, maybe with a little texture. This works for modeling many of the simpler objects in the real world. However, the real world is not always that simple, and some objects get very complicated. Blender allows you to have multiple materials for different pieces of a mesh. This section describes how to use the multiple material features of Blender.

To begin, make sure your 3D window is in Solid, Shaded, or Textured mode so that you can see the effects of your changes.

The Material Index

Default Material Index display

The list of materials that are assigned to a mesh is located by viewing the Editing buttons F9 in a Buttons Window on the Link and Materials tab. On that tab, the buttons used for defining and managing multiple materials are boxed in hot pink in the image to the right. These buttons show the active material name (currently blank), a Material Index display (the 0 Mat 0 ? scroller), and some action buttons labeled New, Delete, Select, Deselect, and Assign. The default panel shown to the right shows that the object Suzanne does not have any materials assigned to it, as evidenced by the 0 Mat 0 material index display.

Blender3D FreeTip.gif
Material Index
In the < 5 Mat 2 > display, the two small arrows allow you to change the active material - if the object uses more than one of them; the first number (5 here) gives you the number of materials used by the current object, and the Mat 2 indicates that it's the material of index 2 which is active.


If a mesh does not have any materials (0 Mat 0 is showing), create a quick and simple new material for the object by clicking the New button. A new material will be created and assigned to the object. It's name, "Material" or "Material.00x", will be shown above the Index display. By default, it will be grey. The Index will now display 1 Mat 1

Meshes and Objects
You can re-use the same mesh within Blender many times to create objects. For example, you may create a mesh called "chair" and then create four duplicate objects and put them around a table. Each instance of the mesh, namely each object, may have its own set of materials assigned (one red chair, one blue chair, ...)


Shading Material panel Index display

The other place the material index for an object is shown is on the Links and Pipeline panel on the Shading F5 Material Buttons window. The image to the right shows that our Suzanne has one MA:terial called "Material" assigned to it, and that it is the first of one materials assigned to her (the 1 Mat 1 index display). The select/scroll button has been clicked and is showing the list of materials in the blend file, and the ADD NEW option is highlighted. You can use this option to create a new material for the object as previously discussed in preceding sections.

Some of the mesh faces can be assigned to different indexes. Some of the indexes can use the same material. Changing the material settings (e.g. color) for a material will change the color of all the faces in all the indexes that use that color. To make it even more flexible (and confusing), the same Material can be used by many different meshes in your scene, so changing a material may even change the color of other meshes. In other words, be careful when changing material colors so that you don't have any unwanted effects. If you are ever in doubt, use the Outliner window to see who uses a particular material.

To make different indexes use different colors, you have to Add New materials, one for each of the indexes, as discussed below. There are three steps, and the steps can be done in any order:

  • Creating Material Index slots
  • Assign Faces to a Material Index
  • Associate a Material with a Material Index


Assigning Material Indexes to a Mesh

A mesh can have multiple materials assigned to it, and the same material can be re-used many times for many meshes. Blender keeps track of which materials are used with which meshes by keeping a list of materials that a mesh uses. Each material is assigned an index, or slot, on the particular mesh's list.

Adding a Material Index

By clicking the New button, you create a new entry or slot on the object's list. Each time you click the New button, Blender adds a new material to the active index.

Active Material
On the Shading Material buttons panels, you are working with a particular material. The material that you are working on is called the Active Material.


Material panel showing 4 indices; index 2 active

The image to the right shows our Editing F9 panel again, this time telling us that Suzanne now has 4 slots, and that we are working with the second, Cyan, as the active material. The color of the material is shown in the swatch.

To select a Material Index, use the left/right scroll arrows (shown in the image as little arrows to the left and right of the 4 Mat 2).

The main, or default material for the object is always in slot 1.

If you want to use an existing material for the new index, you must be in edit mode and use the pulldown menu that will appear in the panel. See this thread for details.

Deleting a Material Index

Take your object out of edit mode. Select the material index slot using the scroll buttons in the material Index display. To delete this index, click the Delete button. Clicking this button disassociates the material with the mesh. It does not delete the material definition from the .blend file, but simply crosses it off the list for that particular object. Any faces of the mesh that may have used that material index will be re-assigned the default material (index/slot 1).

Assigning Face(s) to a Material Index

A "face" is the part of the mesh that actually reflects color and shows the material. A mesh is made up of many faces, connected by edges with corners defined by vertices. All faces of the mesh are assigned to the first material index (x Mat 1) when the mesh was created.

With your object in Edit mode (⇆ Tab), select the faces that you want to have a particular color (material) in the 3D window. Recall that there are vertex, edge, and face select buttons in the window header. You can select multiple faces using ⇧ ShiftRMB Template-RMB.png or Border select. Then, in the Material Index panel in the Buttons window, scroll or ensure that the correct index is showing in the x Mat x material index scroller. Press the Assign button to assign those selected faces to the active material index.

Keeping Track
Unlike Vertex Groups, the Material Indexes cannot be named. So, you might want to open a Text Editor window and jot down what Indexes are used for what faces. For example, 1 for base, 2 for ears, 3 for eyes, 4 for nose.


To assign a face to a different index, simply select the face, scroll to the material you want it to show, and press Assign. The face was assigned to a different index, and that assignment is overridden to what you just specified. If you made a mistake, there's always Undo.

Changing a Material used by a Material Index

When you clicked the New button in the Material Index panel, the active material was assigned to that index. At that moment, the previous index and the new index both pointed to and used the same material. Since they both used the same material, nothing changed in your display. However, you probably want them to be different.

Use the Shading Material buttons to change the appearance of an active material that is referenced by material indexes. In the Buttons window, the Shading (F5 set), Material buttons, Links and Pipeline panel, use the material index Literal scroller to scroll to the index you want to be a different color. Then use the MA: material scroll/select button to Add New material. All of the faces assigned to that index will now show the new color in your 3D window.

To swap out a material on the list for another, go to the Shading Material buttons, Links and Pipeline panel. Use the MA: material scroll/select button to select a different material for that index (recall the panel also displays the active material in its own x Mat x index display). All of the faces assigned to that index will now have the new color.

Material Users
In the Material select scroll box that shows all the materials in your scene, a number to the right of its name shows the number of objects that share that material. A zero means that the material is unused and readily available without affecting any other objects or faces.


Checking your work using Select, Deselect, Query (?)

To see which faces have which index, in Edit mode, deselect all faces by pressing the A key once or twice. Then click the Select button. In the 3D window, the faces that have the active material will be selected, just as if you selected them manually using RMB Template-RMB.png.

If you see that a face has the wrong material assigned to it, select it using the RMB Template-RMB.png, scroll to the correct material index, and press the Assign button.

To see if any faces do NOT have a material assigned to them, use the Deselect button as follows:

  • Select all the faces of the object (A once or twice)
  • Scroll to the first material index, and click Deselect. All the faces that are assigned that index will be de-selected.
  • Repeat the above step for each index.
  • Any faces left are unassigned a material index.

To see the material that a face is assigned to, select the face and click the ? question mark query button next to the x Mat x Material Index display. The display will change to show that face's material index.

Some Examples

Manual-Multiple-Materials flag.jpg

A soda can has base aluminum, but an image wrapper. The pull tab may be a colored aluminum (three indexes). A chair may have a frame and a cushion (two materials). A old-fashioned pencil has an eraser, metal holder, painted wood stylus, shaved part and graphite (five materials). Sunglasses have a frame and lenses (two materials). The computer I am writing this on has about ten. Our favorite flag (right) is one object with three materials (orange, blue and white) The white material index is the default (index 1) and is assigned to both the stars and the background.

Advanced Multiple Materials

A way of mixing materials on a mesh without using geometry for separation is shown in the Mixing Materials with Nodes tutorial.



Introduction
What is Blender?
Introduction
Blender’s History
License
Blender’s Community
About this Manual
What's changed with Blender 2.4
Installing Blender
Introduction
Python
Installing on Windows
Installing on GNU/Linux
Installing on Mac
Installing on other Operating Systems
Configuring Blender
Directory Layout
Starting
The Interface
Introduction
Keyboard and Mouse
Window System
Arranging frames
Headers
Console window
Window Types
Screens (Workspace Layouts)
Scenes
Configuration
Modes
Contexts
Menus
Panels
Buttons and Controls
Internationalization
Your First Animation
1/2: A static Gingerbread Man
2/2: Animating the Gingerbread Man
The Vital Functions
Quick render
Undo and Redo
Default scene
Screenshots
Help!
Setting Preferences
Configuring Preferences
Interface
Editing
Themes
File
System
Interaction in 3D
Introduction
Introduction
Navigation
Introduction
3D View
3D View Options
3D View Usage
Camera View
Layers
Local or Global View
Sketch in 3D Space
Introduction to Grease Pencil
Drawing sketches
Layers and Animation
Converting sketches to geometry
Transformations
Introduction
Basics
- Grab/Move
- Rotate
- Scale
- Gestures
Advanced
- Mirror
- To Sphere
- Shear
- Warp
- Push/Pull
Transform Control
Introduction
Precision of Transformations
Numeric Transformations
Transform Properties
Reset Object Transforms
Manipulators
Transform Orientations
Axis Locking
Pivot Point
- Active object
- Individual Centers
- 3D Cursor
- Median Point
- Bounding Box Center
Snapping
Snap to Mesh
Proportional Edit
Data System and Files
Blender's Data System
Blender's Library and Data System
Blender's Datablocks
Scenes
Working with Scenes
The Outliner Window
Appending and Linking
File operations
Introduction
Opening blender files
Saving blender files
Modeling
Introduction
Introduction
Objects
Objects
Selecting Objects
Editing Objects
Groups and Parenting
Tracking
Duplication
- DupliVerts
- DupliFaces
- DupliGroup
- DupliFrames
Mesh Objects
Meshes
- Mesh Structures
- Mesh Primitives
Selecting
- Selectable Elements
- Selection Basics
- Advanced Selecting
- Selecting Edges
- Selecting Faces
Editing
Basic Editing
- Translation, Rotation, Scale
- Adding Elements
- Deleting Elements
- Creating Faces and Edges
- Mirror editing
Vertex Editing
Edge Editing
Face Editing
Deforming Tools
- Mirror
- Shrink/Fatten Along Normals
- Smooth
- Noise
Duplicating Tools
- Duplicate
- Extrude
- Extrude Dup
- Spin
- Spin Dup
- Screw
Subdividing Tools
- Subdivide
- Subdivide fractal
- Subdivide smooth
- Loop Subdivide
- Knife Subdivide
- Bevel
Miscellaneous Tools
Retopo Tool
Sculpt Mode
Multi Resolution Mesh
Vertex Groups
Weight Paint
Mesh Smoothing
Curve Objects
Curves
Selecting
Editing
Advanced Editing
Surface Objects
Surfaces
Selecting
Editing
Text Objects
Texts
Editing
Meta Objects
Metas
Editing
Empty Objects
Empties
Group Objects
Groups
Scripts
Modeling Scripts
Modifiers and Deformation
Introduction
Introduction
Modifiers Stack
Modify
UVProject
Generate
Array
Bevel
Booleans
Build
Decimate
EdgeSplit
Mask
Mirror
Subsurf
Deform
Armature
Cast
Curve
Displace
Hooks
Lattice
MeshDeform
Shrinkwrap
SimpleDeform
Smooth
Wave
Simulate
Cloth
Collision
Explode
Fluid
Particle Instance
Particle System
Soft Body
Lighting
Introduction
Introduction
Lights
Introduction
Light Properties
Light Attenuation
Light Textures
What Light Affects
Lights In Other Contexts
Shadows
Introduction
Shadow Properties
Raytraced Shadow Properties
Volumetric Lights
Introduction
Lamps
Introduction
Lamp Light
- Raytraced Shadows
Spot Light
- Raytraced Shadows
- Buffered Shadows
- Halos
Area Light
- Raytraced Shadows
Hemi Light
Sun Light
- Raytraced Shadows
- Sky & Atmosphere
Lighting Rigs
Radiosity
Introduction
Rendering
Baking
Scene Light
Ambient Light
Ambient Occlusion
Exposure
Exposure
Materials
Introduction
Introduction to Shading
Materials Introduction
Usage
Assigning a material
Material Preview
Material Options
Multiple Materials
Properties
Diffuse Shaders
Specular Shaders
Ambient Light Effect
Color Ramps
Raytraced Reflections
Raytraced Transparency
Subsurface Scattering (SSS)
Strands
Node Materials
Material Nodes
Nodes Editor
Node Controls
Nodes usage
Nodes Groups
Material Node Types
- Input Nodes
- Output
- Color
- Vector
- Convertor
- Dynamic
Vertex Paint
Using Vertex Paint
Halos
Halos
Textures
Introduction
Introduction
UV/Image Editor
Common Options
Texture Stack
Texture Types
Texture Types
Procedural Textures
Image Textures
Video Textures
Texture Nodes
- Nodes Editor
- Node Controls
- Nodes usage
- Nodes Groups
-- Textures Input Nodes
-- Textures Output Nodes
-- Textures Color Nodes
-- Textures Patterns Nodes
-- Textures Textures Nodes
-- Textures Convertor Nodes
-- Textures Distort Nodes
Texture Plugins
Texture Painting
Painting the Texture
- Projection Paint
Mapping
Mapping
Environment Maps
UV Unwrapping Explained
- Unwrapping a Mesh
- Managing the UV Layout
- Editing the UV Layout
- Applying an Image
Influence
Influence
- Material
-- Bump and Normal
-- Displacement
- Particles
- World
World and Ambient Effects
World
Introduction
World Background
Ambient Effects
Mist
Stars
Rigging
Introduction
Introduction to Rigging
Armatures
Armature Objects
Panels overview
Bones
Visualization
Structure
Selecting
Editing
- Bones
- Properties
- Sketching
- Templating
Skinning
Introduction
Linking Objects to Bones
Skinning to Objects’ Shapes
Retargeting
Posing
Introduction
Visualization
Editing Poses
Pose Library
Using Constraints
Inverse Kinematics
Constraints
Introduction
Introduction
Constraints Common Interface
Constraints’ Stack
Transform Constraints
Copy Location
Copy Rotation
Copy Scale
Limit Distance
Limit Location
Limit Rotation
Limit Scale
Transformation
Tracking Constraints
Clamp To
IK Solver
Locked Track
Stretch To
Track To
Relationship Constraints
Action
Child Of
Floor
Follow Path
Null
Rigid Body Joint
Script
Shrinkwrap
Animation
Introduction
Introduction
The Timeline
Markers
3D Views
Animation Editors
Animation Editors
Ipo Editor
Ipo Curves and Keyframes
Ipo Datablocks
Ipo Types
Ipo Editor Interface
Editing
- Ipo Curves
- Keyframes
Ipo Drivers
Action Editor
Editing Action Channels
NLA Editor
Editing NLA Strips
Strip Modifiers
Animation Techniques
Introduction
Animating Objects
- Using Constraints
- Moving Objects on a Path
Animating Shapes
- Shape Keys
- Editing Shape Keys
- Animating Shape Keys
- Shape Keys Examples
Indirect Shape Animation
Animating Armatures
- Stride
Animating Lamps
Animating Cameras
Animating Materials
Animating Textures
Animating World
Physical Simulation
Introduction
Introduction
Dynamics
Force Fields
Collisions
Particles
Particles
Types
Physics
- Newtonian
- Keyed
- Boids
Visualization
Controlling Emission, Interaction and Time
Cache & Bake
Hair
Children
Vertex Groups
Particle Mode
Soft Body
Introduction
Exterior Forces
Interior Forces
Collisions
Simple Examples
Combination with Armatures
Combination with Hair Particles
Reference
Cloth
Introduction
Fluids
Fluid
Using the Game Engine
Using the Game Engine
Rendering
Introduction
Introduction
Camera
The Camera
Perspective (Vanishing points)
Depth Of Field
Render
Displaying Renders
Basic Options
Antialiasing (Oversampling)
Rendering Animations
Panoramic
Render Baking
Using the Command Line
Output
Output
Video Output
Effects and Post Processing
Introduction
Render Layers
Render Passes
Edges & Toon
Stamp
Color Management & Exposure
Depth Of Field
Motion Blur
Render Performance
Rendering Performance
Distributed Rendering
External Render Engines
Introduction
YafRay
Compositing with nodes
Composite Nodes
Introduction
Nodes Editor
Node Controls
Nodes usage
Nodes Groups
Composite Node types
Composite Node types
Input Nodes
Output Nodes
Color Nodes
Vector Nodes
Filter Nodes
Convertor Nodes
Matte Nodes
Distortion Nodes
Editing Sequences
Introduction
Introduction
The sequencer
Usage
Sequencer Modes
Sequence Screen Layout
Effects
Built-in Effects
Plugin Effects
Audio
Audio Sequences
Extending Blender
Introduction
Introduction
Python Scripting
Python Scripting in Blender
Setting up Python
The Text Editor
A working example
References
Python Scripts
Script Catalog
Bundled Scripts
Plugins
Blender's Plugins System
Texture plugins specifications
Sequence plugins specifications
Game Engine
Introduction
Introduction
The Logic Editor
Usage
Game Properties
Sensors
Introduction
Sensor Types
Controllers
Introduction
Expressions
Actuators
Introduction
Action
Camera
CD
Constraint
Edit Object
Ipo
2D Filters
Game
Message
Motion
Parent
Property
Random
Scene
Shape Action
Sound
State
Visibility
Cameras
Cameras
Dome Camera
Physics
Physics Engine
Material Physics
Object Types
- Static
- No Collision
- Dynamic
- Rigid Body
- Soft Body
- Occluder
- Sensor
Python API
Bullet physics
VideoTexture
Various resources
List of Features
External resources
Game Engine Basics (BSoD Tutorial)
FAQ