Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 16th, 2010  |  syntax: Python  |  size: 0.72 KB  |  views: 117  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import Blender, os
  2. from Blender import *
  3. from Blender.Scene import Render
  4.  
  5. def setTexture(materialName,path):
  6.         mat = Material.Get(materialName)
  7.         textures = mat.getTextures()
  8.         texture  = textures[0].tex
  9.         texture.image = Image.Load(path)
  10.  
  11. def setRenderSize(sizeX,sizeY):
  12.         scn = Scene.GetCurrent()
  13.         context = scn.getRenderingContext()
  14.         Render.EnableDispWin()
  15.         context.extensions = True
  16.         context.renderPath = "//"
  17.         context.sizePreset(Render.PC)
  18.         context.imageType = Render.AVIRAW
  19.         context.sizeX = sizeX
  20.         context.sizeY = sizeY
  21.         context.sFrame = 1
  22.         context.eFrame = 50
  23.         # context.eFrame = 50
  24.         context.renderAnim()
  25.         print context.cFrame
  26.  
  27.  
  28. setTexture('FaceTex','//texture_comp_mod.jpg')
  29.  
  30. setRenderSize(480,320)
clone this paste RAW Paste Data