21.12.2022 Views

python_para_desenvolvedores_2ed

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

292 Blender

# Remove da cena o objeto "default"

cena.objects.unlink(cubo)

# Altera a intensidade da luz

lamp.data.energy = 1.2

# Muda o tipo para "Sun"

lamp.data.type = 1

# Aumenta o número de samples

lamp.data.raySamplesX = 16

lamp.data.raySamplesY = 16

# E a cor

lamp.data.col = 1., .9, .8

# Cria outra fonte de luz

lamp1 = Blender.Lamp.New('Lamp')

lamp1.energy = 0.5

lamp1.col = .9, 1., 1.

_lamp1 = Blender.Object.New('Lamp')

# Muda o lugar da fonte (default = 0.0, 0.0, 0.0)

_lamp1.setLocation(6., -6., 6.)

# "Prende" a fonte de luz na cena

_lamp1.link(lamp1)

cena.objects.link(_lamp1)

# Cria um material

material1 = Blender.Material.New('newMat1')

material1.rgbCol = [.38, .33, .28]

material1.setAlpha(1.)

# Cria uma textura

textura1 = Blender.Texture.Get()[0]

textura1.setType('Clouds')

textura1.noiseType = 'soft'

textura1.noiseBasis = Blender.Texture.Noise['VORONOICRACKLE']

# Coloca no material

material1.setTexture(0, textura1)

mtex1 = material1.getTextures()[0]

mtex1.col = .26, .22, .18

mtex1.mtNor = 1

mtex1.neg = True

mtex1.texco = Blender.Texture.TexCo['GLOB']

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!