Вход/Регистрация
Введение в написание скриптов на Питоне для Блендера 2.5x. Примеры кода
вернуться

Larsson Thomas

Шрифт:

for n,value in enumerate(values):

elt = ramp.elements[n]

(pos, color) = value

elt.position = pos

elt.color = color

return

def createFlameTexture:

tex = bpy.data.textures.new('Flame', type = 'CLOUDS')

createColorRamp(tex, [(0.2, (1,0.5,0.1,1)), (0.8, (0.5,0,0,0))])

tex.noise_type = 'HARD_NOISE'

tex.noise_scale = 0.7

tex.noise_depth = 5

return tex

def createStencilTexture:

tex = bpy.data.textures.new('Stencil', type = 'BLEND')

tex.progression = 'SPHERICAL'

createColorRamp(tex, [(0.0, (0,0,0,0)), (0.85, (1,1,1,0.6))])

return tex

def createEmitTexture:

tex = bpy.data.textures.new('Emit',

type = 'BLEND')

tex.progression = 'LINEAR'

createColorRamp(tex, [(0.1, (1,1,0,1)), (0.3, (1,0,0,1))])

return tex

def createSmokeTexture:

tex = bpy.data.textures.new('Smoke', type = 'CLOUDS')

createColorRamp(tex, [(0.2, (0,0,0,1)), (0.6, (1,1,1,1))])

tex.noise_type = 'HARD_NOISE'

tex.noise_scale = 1.05

tex.noise_depth = 5

return tex

def createFireMaterial(textures, objects):

(flame, stencil, emit) = textures

(emitter, empty) = objects

mat = bpy.data.materials.new('Fire')

mat.specular_intensity = 0.0

mat.use_transparency = True

mat.transparency_method = 'Z_TRANSPARENCY'

mat.alpha = 0.0

mat.use_raytrace = False

mat.use_face_texture = True

mat.use_shadows = False

mat.use_cast_buffer_shadows = True

mtex = mat.texture_slots.add

mtex.texture = emit

mtex.texture_coords = 'UV'

mtex.use_map_color_diffuse = True

mtex = mat.texture_slots.add

mtex.texture = stencil

mtex.texture_coords = 'UV'

mtex.use_map_color_diffuse = False

mtex.use_map_emit = True

mtex.use_stencil = True

mtex = mat.texture_slots.add

mtex.texture = flame

mtex.texture_coords = 'UV'

mtex.use_map_color_diffuse = True

mtex.use_map_alpha = True

#mtex.object = empty

return mat

def createSmokeMaterial(textures, objects):

(smoke, stencil) = textures

(emitter, empty) = objects

mat = bpy.data.materials.new('Smoke')

mat.specular_intensity = 0.0

mat.use_transparency = True

mat.transparency_method = 'Z_TRANSPARENCY'

mat.alpha = 0.0

mat.use_raytrace = False

mat.use_face_texture = True

mat.use_shadows = True

mat.use_cast_buffer_shadows = True

mtex = mat.texture_slots.add

mtex.texture = stencil

mtex.texture_coords = 'UV'

mtex.use_map_color_diffuse = False

  • Читать дальше
  • 1
  • ...
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • ...

Ебукер (ebooker) – онлайн-библиотека на русском языке. Книги доступны онлайн, без утомительной регистрации. Огромный выбор и удобный дизайн, позволяющий читать без проблем. Добавляйте сайт в закладки! Все произведения загружаются пользователями: если считаете, что ваши авторские права нарушены – используйте форму обратной связи.

Полезные ссылки

  • Моя полка

Контакты

  • chitat.ebooker@gmail.com

Подпишитесь на рассылку: