Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def createMaterial(material):
- tex = bpy.data.textures.new('ColorTex', type = 'IMAGE')
- tex.image = bpy.data.images.load(realpath_of_image)
- tex.use_alpha = True
- # Create shadeless material and MTex
- mat = bpy.data.materials.new('TexMat')
- mat.use_shadeless = True
- mtex = mat.texture_slots.add()
- mtex.texture = tex
- mtex.texture_coords = 'UV'
- mtex.use_map_color_diffuse = True
- return mat
- def make_chnges(components, randomno):
- ob = bpy.data.objects[0]
- mat = createMaterial(material)
- ob.data.materials.append(mat)
- ob.active_material = mat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement