2

Is it possible to add a texture or material to more than one object at a time?

Duarte Farrajota Ramos
  • 59,425
  • 39
  • 130
  • 187
Tom
  • 33
  • 1
  • 6

4 Answers4

5

It's possible link the materials on a selection of objects to a single "active" object.

  1. Add an material to an object: enter image description here

  2. Select all of the objects you want the material on, then select the object from step 1 (it's important that you select that object last; it needs to be the active object). Hit CTRL+L and select Materials

enter image description here

ajwood
  • 10,063
  • 11
  • 60
  • 112
4

This is an easy way to copy a material to many objects.
First the object with the material should be the active object while all the other objects you want to copy the material to are selected. Then press the "Copy Material to Others" button in the material tab of the property window.
copy material button


animated gif showing the process

David
  • 49,291
  • 38
  • 159
  • 317
3

For 2.8+ you can go to the 3D View header menu Object > Make Links > Materials

enter image description here

You can also access it from the material slots dropdown Copy to Selected option

enter image description here

Materials are always copied from the active object to the others selected. Shift clicking on an already selected object makes it the active one.

Duarte Farrajota Ramos
  • 59,425
  • 39
  • 130
  • 187
2

Also you can select all those objects you want to assign material to and execute the code:

#assuming there's image loaded in Blender and called 'sky_1'. It's the one you'd like to assign
img = bpy.data.images['sky_1.jpg']
imageTexture = bpy.data.textures.new('Image_Texture', type = 'IMAGE')
imageTexture.image = img

#check presence of material with the same name
if bpy.data.materials.get("textureMaterial") is not None:
    materialToApply = bpy.data.materials["textureMaterial"]
else:
  # create material
  materialToApply = bpy.data.materials.new('textureMaterial')
  materialTexture = materialToApply.texture_slots.add()
  materialTexture.texture = imageTexture
  materialTexture.texture_coords = 'UV'
  materialTexture.mapping = 'FLAT' 

#loop through selected objects and assign the material
for x in bpy.context.selected_objects:
  me = x.data
  me.materials.append(materialToApply)

The small advantage of this (at least for me, I always check twice which one is active if transfering materials) is that it doesn't really matter the objects' selection order in this case.

Mr Zak
  • 10,848
  • 4
  • 28
  • 77