Is it possible to add a texture to more than one object at a time?
It's possible link the materials on a selection of objects to a single "active" object.
Add an material to an object:
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
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.
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.